【发布时间】:2015-01-10 19:57:27
【问题描述】:
所以我希望弹出一个警报告诉我一条消息,然后我希望它等待我,直到我按 OK,然后它将继续使用该功能。例如。
@IBAction Alert() {
let alertController = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.Alert)
alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alertController, animated: true, completion: nil)
}
问题是现在它什么都不会做,如果我只是在之后输入一个函数,它会直接执行它,而不是等到我按下确定。有谁知道怎么做?
顺便说一句,在这个例子中,消息是标题,消息,我知道这不是我在这种情况下需要的;)
提前致谢!
【问题讨论】:
-
你的意思是你需要在按下确定按钮后执行一个任务?
-
没错@MidhunMP
标签: ios swift uialertcontroller