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")

                }

            }))

  • 相关阅读:
    POJ 1061
    hihocoder 1330
    HDU 1525
    UVALive 3938
    POJ 2528
    HDU 1754
    《ACM-ICPC程序设计系列 数论及其应用》例题个人答案记录
    URAL 1277
    HDU 3746
    HDU 2087
  • 原文地址:https://www.cnblogs.com/ChouDanDan/p/5088989.html
Copyright © 2011-2022 走看看