【发布时间】:2014-08-03 03:00:21
【问题描述】:
我正在向用户展示UIAlertView,但我不知道如何编写处理程序。这是我的尝试:
let alert = UIAlertController(title: "Title",
message: "Message",
preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Okay",
style: UIAlertActionStyle.Default,
handler: {self in println("Foo")})
我在 Xcode 中遇到了一堆问题。
文档说convenience init(title title: String!, style style: UIAlertActionStyle, handler handler: ((UIAlertAction!) -> Void)!)
目前,整个街区/封闭区有点超出我的想象。任何建议都非常感谢。
【问题讨论】:
标签: ios uialertview swift uialertcontroller