When using Uialertcontroller in the project, it was found that there was no way to cancel the control at the click of the space, the gesture was not recognized, and a unique Cancel button must be added when the control was used. That is, there must be a button of type Uialertactionstylecancel. If there are 2 items that will cause an error, if not, click on the blank control to not disappear.
Uialertcontroller *Alertcontroller = [Uialertcontroller alertcontrollerwithtitle:@ " Change Type " Message:nil Preferredstyle:uialertcontrollerstyleactionsheet];
[Alertcontroller addaction:[uialertaction actionwithtitle:@"Redeem"Style:uialertactionstyledefault handler:^ (Uialertaction *_nonnull Action) {NSLog (@"Click to confirm"); }]]; [Alertcontroller addaction:[uialertaction Actionwithtitle:@"return"Style:uialertactionstylecancel handler:^ (Uialertaction *_nonnull Action) {NSLog (@"Click to confirm"); }]]; //as it is a controller directly modal out just fine[self Presentviewcontroller:alertcontroller animated:yes completion:nil];
Uialertcontroller Tai Hang