objective c - Multiple UIAlertControllers in iOS -
in app there scenarios multiple alerts come. in ios8 uialertview turned uialertcontroller, not able show multiple alerts can not present 2 or more controllers @ same time.
how can achieve using uialertcontroller?
here method show multiple alertcontrollers :
uialertcontroller *av = [uialertcontroller alertcontrollerwithtitle:title message:msg preferredstyle:uialertcontrollerstylealert]; uialertaction *cancelaction = [uialertaction actionwithtitle:kalertok style:uialertactionstylecancel handler:^(uialertaction *action) { }]; [av addaction:cancelaction]; uiwindow *alertwindow = [[uiwindow alloc]initwithframe:[uiscreen mainscreen].bounds]; alertwindow.rootviewcontroller = [[uiviewcontroller alloc]init]; alertwindow.windowlevel = uiwindowlevelalert + 1; [alertwindow makekeyandvisible]; [alertwindow.rootviewcontroller presentviewcontroller:av animated:yes completion:nil];
Comments
Post a Comment