zoukankan      html  css  js  c++  java
  • Swift

     

            let alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: UIAlertControllerStyle.Alert)

            alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.Default, handler: nil))

            self.presentViewController(alert, animated: true, completion: nil)

            alert.addAction(UIAlertAction(title: "lala", style: UIAlertActionStyle.Cancel, handler: { (action) in

                switch action.style{

                case .Default:

                    print("default")

                    

                case .Cancel:

                    print("cancel")

                    

                case .Destructive:

                    print("destructive")

                }

            }))

            

            alert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: { action in

                switch action.style{

                case .Default:

                    print("default")

                    

                case .Cancel:

                    print("cancel")

                    

                case .Destructive:

                    print("destructive")

                }

            }))

  • 相关阅读:
    Android Handler研究(1)
    知识树杂谈Java面试(4)
    BAT级别分类
    知识树杂谈Android面试(3)
    知识树杂谈(2)
    mac iterm2安装、sshpass密码记住
    一万小时定律
    第17章(下)--集合
    第17章(中)--集合
    第17章(上)--集合
  • 原文地址:https://www.cnblogs.com/ChouDanDan/p/5088989.html
Copyright © 2011-2022 走看看