【发布时间】:2016-01-01 14:57:29
【问题描述】:
我想调用一个函数而不是使用带有 UIAlertAction 的闭包。是否可以获得对拥有 UIAlertAction 的 UIAlertController 的引用?
alert = UIAlertController(title: "City", message: "Enter a city name", preferredStyle: UIAlertControllerStyle.Alert)
UIAlertActionStyle.Default, handler: okAlert)
//...
func okAlert(action: UIAlertAction) {
// Get to alert here from action?
}
【问题讨论】:
标签: swift uialertcontroller uialertaction