Skip to content

ivanyorgov/IYAlertView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IYAlertView

[![CI Status](http://img.shields.io/travis/ivan yorgov/IYAlertView.svg?style=flat)](https://travis-ci.org/ivan yorgov/IYAlertView) Version License Platform

Usage

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

Requirements

Installation

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

pod "IYAlertView"

Sample usage

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

Author

ivan yorgov, [email protected]

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published