如何从UIAlertAction内引用self
?Swift:单击更改UIAlertAction标题
refreshAlert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: { (action: UIAlertAction!) in
// self.title = String("HELLO")
print("Handle Ok logic here")
}))
我想让UIAlertAction的标题在点击时(以及其他事物)发生变化。如何在命令中引用我自己在点击时做什么?
我如何让它在那里点击一个UIAlertAction如果您想从自己的处理程序访问UIAlertAction
对象不关闭警报操作
当点击按钮时,您无法防止'UIAlertController'解除关闭。 – rmaddy