首页 > 其他 > 详细

UIActionSheet

时间:2015-11-19 13:00:47      阅读:250      评论:0      收藏:0      [点我收藏+]

introduced=2.0, deprecated=8.3 早已废弃 还是拥抱 UIAlertController 吧

创建UIActionSheet

let actionSheel = UIActionSheet()
actionSheel.addButtonWithTitle("取消")
actionSheel.addButtonWithTitle("选项一")
actionSheel.addButtonWithTitle("选项二")
actionSheel.cancelButtonIndex = 0
actionSheel.delegate = self
actionSheel.showInView(self.view)

实现代理 先遵守协议 UIActionSheetDelegate

func actionSheet(actionSheet: UIActionSheet, clickedButtonAtIndex buttonIndex: Int) {
        print(actionSheet.buttonTitleAtIndex(buttonIndex)!)
        if buttonIndex == actionSheet.cancelButtonIndex{
            print("取消了!")
        }else{
            print("都说了已经废弃了!!!")
        }
    }

  

UIActionSheet

原文:http://www.cnblogs.com/spaceID/p/4977054.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!