/UIAlertController-SBAWindow

Light-weight category that adds -showAnimated method to UIAlertController. Presenting UIAlertControllers from anywhere in window.

Primary LanguageObjective-CMIT LicenseMIT

UIAlertController+SBAWindow

=============================================

Light-weight category that adds -showAnimated method to UIAlertController. Presenting UIAlertControllers from anywhere in the window.

Installation

Use CocoaPods.

pod 'UIAlertController+SBAWindow'

Usage

UIAlertController* controller=[UIAlertController alertControllerWithTitle:@"Test controller" message:@"message" preferredStyle:UIAlertControllerStyleActionSheet];

UIAlertAction* action1=[UIAlertAction actionWithTitle:@"Action1" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

}];

UIAlertAction* action2=[UIAlertAction actionWithTitle:@"Action2" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

}];


UIAlertAction* cancel=[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {

}];

[controller addAction:action1];
[controller addAction:action2];
[controller addAction:cancel];

[controller showAnimated:TRUE];

License

UIAlertController+SBAWindow is under MIT. See LICENSE file for more info.