【发布时间】:2014-11-30 07:15:21
【问题描述】:
我想从 UIAlertAction 调用 segue,但处理程序在 UIAlertController 完成解除之前不会执行。
let editMenu = UIAlertController(title: "Edit", message: nil, preferredStyle: .ActionSheet)
let myAction = UIAlertAction(title: "My Action", style: UIAlertActionStyle.Default, handler: {(action: UIAlertAction!) -> Void in
tableView.setEditing(false, animated: true)
self.performSegueWithIdentifier("some_segue", sender: self)
})
editMenu.addAction(myAction)
self.presentViewController(editMenu, animated: false, completion: nil)
我希望处理程序立即执行。
【问题讨论】: