使用UIAlertControler的好例子

时间:2016-08-08 10:03:03

标签: ios swift uialertcontroller

我正在寻找使用UIAlertController和UISlider,UISegmentedControl,UIStepper的好例子。

我不能使用UIAlert和UIActionSheet,我也不知道如何将滑块,分段控件或步进器添加到AlertController并在UITableViewController上显示。

我正在使用swift进行编程。

1 个答案:

答案 0 :(得分:0)

let alertController = UIAlertController(title: "Hello", message: "Do you want to save changes?", preferredStyle: .Alert)


            let OKAction = UIAlertAction(title: "DON'T SAVE", style: .Default) { (action) in
                profileBack = "false"
                self.dismissViewControllerAnimated(false, completion: nil)
            }
            alertController.addAction(OKAction)

            let destroyAction = UIAlertAction(title: "SAVE", style: .Default) { (action) in
                self.callUpdateBasicDetailsApi()

            }
            alertController.addAction(destroyAction)

            self.presentViewController(alertController, animated: true) {
                // ...
            }
相关问题