[![CI Status](http://img.shields.io/travis/ivan yorgov/IYAlertView.svg?style=flat)](https://travis-ci.org/ivan yorgov/IYAlertView)
To run the example project, clone the repo, and run pod install
from the Example directory first.
IYAlertView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "IYAlertView"
Create action for a button in the alert
IYAlertViewAction *alertActionDefault = [IYAlertViewAction alertActionWithType:kAlertTypeDefault
title:@"Button title"
andHandler:^(id alert) {
//Do something after a button was pressed
}];
Present alert with a default action - button with title "OK".
[IYAlertView presentAlertWithTitle:@"Title"
message:@"Message"
andActions:nil
inViewContext:self.view];
Create alert with two or more buttons
IYAlertViewAction *alertActionDefault = [IYAlertViewAction alertActionWithType:kAlertTypeDefault
title:@"Button title"
andHandler:^(id alert) {
//Do something after a button was pressed
}];
IYAlertViewAction *alertActionDestructive = [IYAlertViewAction alertActionWithType:kAlertTypeDestructive
title:@"Cancel"
andHandler:^(id alert) {
//Do something after a button was pressed
}];
[IYAlertView presentAlertWithTitle:@"Title"
message:@"Message"
andActions:@[alertActionDefault, alertActionDestructive]
inViewContext:self.view];
ivan yorgov, [email protected]
IYAlertView is available under the MIT license. See the LICENSE file for more info.