ios - Enable UIAlertAction of UIAlertController only after input -
i using uialertcontroller present dialog uitextfield , 1 uialertaction button labeled "ok". how disable button until number of characters (say 5 characters) input uitextfield ? add following property in header file @property(nonatomic, strong)uialertaction *okaction; then copy following code in viewdidload method of viewcontroller self.okaction = [uialertaction actionwithtitle:@"ok" style:uialertactionstyledefault handler:nil]; self.okaction.enabled = no; uialertcontroller *controller = [uialertcontroller alertcontrollerwithtitle:nil message:@"enter text" preferredstyle:uialertcontrollerstylealert]; [controller addtextfieldwithconfigurationhandler:^(uitextfield *textfield) { textfield.delegate = self; }]; [controller ...