swift 底部警告框

前端之家收集整理的这篇文章主要介绍了swift 底部警告框前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。



1. 设置页面的代理

class SecondViewController: TFBaseViewController,UIActionSheetDelegate {

2. 源码
  //底部警告框
    func testUIActionSheet()
    {
       let actionSheet = UIActionSheet()
        actionSheet.addButtonWithTitle("取消")
        actionSheet.addButtonWithTitle("确定")
        actionSheet.addButtonWithTitle("选择")
        actionSheet.cancelButtonIndex = 0
        actionSheet.delegate = self
        actionSheet.showInView(self.view)
    }
    
    func actionSheet(actionSheet: UIActionSheet,didDismissWithButtonIndex buttonIndex: Int){
        
      print("您点击了:"+actionSheet.buttonTitleAtIndex(buttonIndex)!)
        
    }
原文链接:https://www.f2er.com/swift/323845.html

猜你在找的Swift相关文章