untouchable741 / UIAlertController-Show

Light-weight extension to UIAlertController to add -show method for presenting Alerts / Action Sheets from anywhere

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UIAlertController+Show

Light-weight extension that adds -show method to UIAlertController. Presenting UIAlertControllers from anywhere, just like UIAlertView.

##Example Usage

This extension provides an API for UIAlertController that mimics the interface for UIAlertViews.

Example in Objective-C:

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Hello"
                                                                         message:@"Just like UIAlertViews!"
                                                                  preferredStyle:UIAlertControllerStyleAlert];

[alertController show];

Example in Swift:

let alertController = UIAlertController(title: "Hello",
                                        message: "Just like UIAlertViews!",
                                        preferredStyle: .Alert))

alertController.show()

##Setup via CocoaPods

Add UIAlertController+Show to your Podfile

pod 'UIAlertController+Show'

Then, import the framework where needed.

Objective-C:

@import UIAlertController_Show;

Swift:

import UIAlertController_Show

About

Light-weight extension to UIAlertController to add -show method for presenting Alerts / Action Sheets from anywhere

License:MIT License


Languages

Language:Swift 57.5%Language:Ruby 42.5%