LEAlertController 0.1.7

LEAlertController 0.1.7

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Apr 2015

Maintained by Lasha Efremidze.




Overview

LEAlertController is a lightweight UIAlertController extension for iOS 7 support. Fallbacks to using UIAlertView and UIActionSheet for iOS 7.

UIAlertView Screenshot UIActionSheet Screenshot

Usage

Installation

LEAlertController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "LEAlertController"

To run the example project, clone the repo, and run pod install from the Example directory first.

Example

Use like a UIAlertController

LEAlertController *alertController = [LEAlertController alertControllerWithTitle:@"Default Style" message:@"A standard alert." preferredStyle:LEAlertControllerStyleAlert];

LEAlertAction *cancelAction = [LEAlertAction actionWithTitle:@"Cancel" style:LEAlertActionStyleCancel handler:^(LEAlertAction *action) {
    // handle cancel button action
}];
[alertController addAction:cancelAction];

LEAlertAction *defaultAction = [LEAlertAction actionWithTitle:@"OK" style:LEAlertActionStyleDefault handler:^(LEAlertAction *action) {
    // handle default button action
}];
[alertController addAction:defaultAction];

[self presentAlertController:alertController animated:YES completion:nil];

License

LEAlertController is available under the MIT license. See the LICENSE file for more info.