XWAlertController provides similar API like UIAlertController, you can also use the same API for iOS7.
pod 'XWAlertController'
You can use XWAlertController like the following example:
XWAlertController *alert = [XWAlertController alertControllerWithTitle:@"Title"
message:@"This is message for AlertController"
preferredStyle:XWAlertControllerStyleAlert];
[alert addAction:[XWAlertAction actionWithTitle:@"OK" style:XWAlertActionStyleDefault handler:^(XWAlertAction * _Nonnull action) {
NSLog(@"Action1");
}]];
[alert addAction:[XWAlertAction actionWithTitle:@"Cancel" style:XWAlertActionStyleDestructive handler:^(XWAlertAction * _Nonnull action) {
NSLog(@"Action2");
}]];
[self presentViewController:alert animated:YES completion:NULL];
The source code is distributed under the nonviral MIT License. It's the simplest most permissive license available.
- v0.0.1: May 2 2016