swift 底部警告框

swift 底部警告框_第1张图片


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)!)
        
    }


你可能感兴趣的:(swift 底部警告框)