Latest 0.1.5
Homepage https://github.com/Elethom/PRAlertController
License MIT
Platforms ios 6.0, requires ARC
Authors

CocoaPods
Language
License

Tweet
Twitter

Alert controller with the same APIs as iOS 8 SDK (text field not supported), compatible with iOS 7.

Installation

With CocoaPods

In your Podfile:

pod 'PRAlertController'

Usage

It has exactly the same APIs as iOS 8 SDK does except the text field part. Besides, with -show, -dismiss methods you can pop up alerts wherever you want without having to worry about how to get current view controller’s pointer.

Example:

PRAlertController *alertController = [PRAlertController alertControllerWithTitle:@"Title"
                                                                         message:@"This is the message."
                                                                  preferredStyle:PRAlertControllerStyleAlert];
PRAlertAction *firstAction = [PRAlertAction actionWithTitle:@"First"
                                                      style:PRAlertActionStyleDefault
                                                    handler:^(PRAlertAction *action) {
                                                        [self doFirstAction];
                                                    }];
PRAlertAction *secondAction = [PRAlertAction actionWithTitle:@"Second"
                                                       style:PRAlertActionStyleDefault
                                                     handler:^(PRAlertAction *action) {
                                                         [self doSecondAction];
                                                     }];
PRAlertAction *destructiveAction = [PRAlertAction actionWithTitle:@"Destructive"
                                                            style:PRAlertActionStyleDestructive
                                                          handler:^(PRAlertAction *action) {
                                                              [self doDestructiveAction];
                                                          }];
PRAlertAction *cancelAction = [PRAlertAction actionWithTitle:@"Cancel"
                                                       style:PRAlertActionStyleCancel
                                                     handler:^(PRAlertAction *action) {
                                                         [self doCancelAction];
                                                     }];
[alertController addAction:firstAction];
[alertController addAction:secondAction];
[alertController addAction:destructiveAction];
[alertController addAction:cancelAction];
[alertController show];

Easy as it seems.

License

This code is distributed under the terms and conditions of the MIT license.

Donate

You can support me by:

:-)

Contact

Latest podspec

{
    "name": "PRAlertController",
    "version": "0.1.5",
    "summary": "Alert controller with same API as iOS 8 SDK (text field not supported), compatible with iOS 7.",
    "homepage": "https://github.com/Elethom/PRAlertController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Elethom Hunter": "[email protected]"
    },
    "social_media_url": "http://twitter.com/ElethomHunter",
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/Elethom/PRAlertController.git",
        "tag": "0.1.5"
    },
    "source_files": "Classes/*.{h,m}",
    "public_header_files": "Classes/*.h",
    "requires_arc": true
}

Pin It on Pinterest

Share This