Latest 0.0.5
Homepage https://github.com/project-badass/UIViewController-Alert
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors ,

UIViewController-Alert

iOS7 and 8 compatible convenience methods for displaying alerts and action sheets

Installation

Use CocoaPods to add to your project:

pod 'UIViewController+Alert'

or download the source and manually add it to your project.

Usage

At the top of your view controller, add this import statement:

#import <UIViewController+Alert/UIViewController+Alert.h>

Displaying an Action Sheet

// define the text to be displayed in the action sheet
NSArray *options = @[@"Option 1", @"Option 2"];

// define the actions to occur when tapping on an option
NSArray *handlers = @[^{ NSLog(@"Option 1 callback"); }, ^{ NSLog(@"Option 2 callback"); }];

// show the action sheet
[self showActionSheetWithTitle:@"Title" message:@"Message" options:options handlers:handlers];

Displaying an Alert

[self showAlertWithTitle:@"Title" andMessage:@"Message"];

Latest podspec

{
    "name": "UIViewController+Alert",
    "version": "0.0.5",
    "license": {
        "type": "MIT"
    },
    "summary": "Convenience class for displaying alerts and action sheets on iOS 8 and above (using UIAlertController)",
    "homepage": "https://github.com/project-badass/UIViewController-Alert",
    "authors": {
        "Ameesh Kapoor": "[email protected]",
        "Jim Cervone": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/project-badass/UIViewController-Alert.git",
        "tag": "0.0.5"
    },
    "source_files": "UIViewController+Alert.{h,m}",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This