xtravar / KZAlertController-iOS7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KZAlertController-iOS7

This class allows you to code against UIAlertController APIs, but still support iOS 7. The only difference between the SDK8 API and this is that you must allocate with 'KZUI' classes. The iOS 8 UIAlertController will be created if it is available.

Not a whole lot of testing has been done yet, so I'm sure there are scenarios that aren't supported well.

Example code:

UIAlertController *ac = [KZUIAlertController alertControllerWithTitle:@"Title"
                                                              message:@"Message"
                                                       preferredStyle:UIAlertControllerStyleAlert];
                                                       
UIAlertAction *action = [KZUIAlertAction actionWithTitle:@"Cancel"
                                                   style:UIAlertActionStyleDefault
                                                 handler:^(UIAlertAction *action) {
                                                          NSLog(@"God bless Objective-C");
                                                 }];
                                                       

About


Languages

Language:Objective-C 100.0%