我希望弹出一个警告框,告诉我一条信息,然后等待我按下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)
}
问题在于现在它什么也不做,如果我之后只是放进一个函数,它会直接执行,而不是等到我按下“确定”按钮。有人知道怎么做吗?顺便说一句,在这个例子中,消息将是标题、消息,我知道这不是我在这种情况下需要的 ;) 预先感谢!