Latest 0.3.0
Homepage https://github.com/ivanyorgov/IYAlertView
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit
Authors

[![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.

Latest podspec

{
    "name": "IYAlertView",
    "version": "0.3.0",
    "summary": "IYAlertView manages UIAlertView and UIAlertController with blocks",
    "description": "                       IYAlertView is used to for both UIAlertView and UIAlertController.n                    If the iOS version is newer than 8.0 it automatically uses the UIAlertController for presenting alert.n                    It also uses only block for the actions of the buttons.n",
    "homepage": "https://github.com/ivanyorgov/IYAlertView",
    "license": "MIT",
    "authors": {
        "ivan yorgov": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ivanyorgov/IYAlertView.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "IYAlertView": [
            "Pod/Assets/*.png"
        ]
    },
    "public_header_files": "Pod/Classes/**/*.h",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This