我在操作表中有一个喜欢按钮:
likeAction = UIAlertAction(title: "Like this post", style: UIAlertActionStyle.Default, handler: { (action) -> Void in
println("like pressed")
})
Run Code Online (Sandbox Code Playgroud)
一旦按下,我想将标题更新为“与此帖子不同”
标题是只读的,并且 UIAlertActions 上没有 SetTitle() 函数。
非常感谢您的想法。
这对我有用。
self.alertAction.setValue("New Title", forKeyPath: "title")
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助。
| 归档时间: |
|
| 查看次数: |
1272 次 |
| 最近记录: |