ios - Swift: Change UIAlertAction title on click -


how reference self within uialertaction?

refreshalert.addaction(uialertaction(title: "ok", style: .default, handler: { (action: uialertaction!) in         // self.title = string("hello")         print("handle ok logic here")     })) 

i want title of uialertaction change when clicked on (as other things). how reference myself in command when clicked on?

how make clicking on uialertaction doesn't close alert action

if want access uialertaction object own handler, use provided action parameter passed action handler block.

however, cannot change title of action after has been created since title parameter readonly.

also, however, there little reason change title anyway, alerts dismissed upon tapping alert action's button.


Comments