LLAEasyAlertManager 1.0.4

LLAEasyAlertManager 1.0.4

Daisuke T维护。




  • daisuke-t-jp


Platform Language Swift%205.0 Carthage compatible Cocoapods Build Status

这是什么?

LLAEasyAlertManager 是一个易于使用的UIAlertController类。

安装

Carthage

github "daisuke-t-jp/LLAEasyAlertManager"

CocoaPods

use_frameworks!

target 'target' do
pod 'LLAEasyAlertManager'
end

使用

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