this question has answer here:
how display text entry field in alert input user , use input in application (display input on label ) ?
thank time.
uialertcontroller *alert = [uialertcontroller alertcontrollerwithtitle:@"enter text" message:@"enter text below" preferredstyle:uialertcontrollerstylealert]; uialertaction *submit = [uialertaction actionwithtitle:@"submit" style:uialertactionstyledefault handler:^(uialertaction * action) { if (alert.textfields.count > 0) { uitextfield *textfield = [alert.textfields firstobject]; textfield.text // text } }]; [alert addaction:submit]; [alert addtextfieldwithconfigurationhandler:^(uitextfield *textfield) { textfield.placeholder = @"something"; // if needs }]; [self presentviewcontroller:alert animated:yes completion:nil];
Comments
Post a Comment