What is this?
LLAEasyAlertManager is class for easy use of UIAlertController.
Install
Carthage
github "daisuke-t-jp/LLAEasyAlertManager"
CocoaPods
use_frameworks!
target 'target' do
pod 'LLAEasyAlertManager'
end
Usage
import LLAEasyAlertManager
/**
* Present alert with
* - Message
* - OK button
*/
LLAEasyAlertManager.sharedInstance.present(self, message: "Message")
/**
* Present alert with
* - Message
* - Title
* - OK button
*/
LLAEasyAlertManager.sharedInstance.present(self, message: "MessageTitle", title: "title")
/**
* Present alert with
* - Message
* - Title
* - OK button
* - Default action handler
*/
LLAEasyAlertManager.sharedInstance.present(self,
message: "HandlerDefault",
title: "title",
handlerDefault: { (action: UIAlertAction!) in
print("default") })
/**
* Present alert with
* - Message
* - Title
* - OK button
* - Cancel button
* - Cancel action handler
*/
LLAEasyAlertManager.sharedInstance.present(self,
message: "HandlerCancel",
title: "title",
handlerDefault: nil,
handlerCancel: { (action: UIAlertAction!) in
print("cancel") })
/**
* Present alert with
* - Message
* - Title
* - OK button
* - Cancel button
* - Default action handler
* - Cancel action handler
*/
LLAEasyAlertManager.sharedInstance.present(self,
message: "HandlerBoth",
title: "title",
handlerDefault: { (action: UIAlertAction!) in
print("default")},
handlerCancel: { (action: UIAlertAction!) in
print("cancel")}