Uialertcontroller Tai Hang

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.