LLAEasyAlertManager 1.0.4

LLAEasyAlertManager 1.0.4

Maintained by Daisuke T.




  • By
  • daisuke-t-jp


Platform Language Swift%205.0 Carthage compatible Cocoapods Build Status

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")}