UIAlertController 控制器多能用法 ios8新

 

wKioL1R0TA6CdHD_AABHkcKtboU571.jpg

wKiom1R0S46zbHtJAABbf0Fgkwo665.jpg



var alert:UIAlertController = UIAlertController(title: "確定不玩了嘛?", message: "", preferredStyle: UIAlertControllerStyle.ActionSheet)

        //UIAlertControllerStyle.ActionSheet

        //UIAlertControllerStyle.Alert

        

        var action1 = UIAlertAction(title: "確定", style: UIAlertActionStyle.Destructive) { (action) -> Void in

            println("exe");

        }

        var action2 = UIAlertAction(title: "取消", style: UIAlertActionStyle.Cancel) { (action) -> Void in

            println("Cancel");

        }

        

        alert.addAction(action1);

        alert.addAction(action2);

        

        self.presentViewController(alert, animated: true) { () -> Void in

            println(11);

        }





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章