LEAlertController icon indicating copy to clipboard operation
LEAlertController copied to clipboard

UIAlertController with iOS 7 support

LEAlertController

CI Status Version License Platform

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"

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];

Contributions

Contributions are totally welcome.

License

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