Latest 1.0.8
Homepage https://github.com/kagenMonster/KMRAlert
License MIT
Platforms ios 8.0, requires ARC
Authors

KMRAlertKit

  • Swift编写对UIAlertView, UIActionSheet, UIAlertController的封装
  • 支持iOS8以上的系统(也可支持iOS7,具体看下方安装部分)
  • 支持添加输入框
  • 支持对输入框添加监听事件
  • iOS8以上支持UIAlertAction的enable
  • 一些关于适配的错误 会有打印警告
  • 如果直接拖进工程则支持ios7 以上

1.0.4

  • 新增删除Action
  • 新增删除TextField

install

cocoapods

在你的Podfile中添加下面内容

pod 'KMRAlert'

可拖进工程

  • 如果直接拖进工程则支持ios7 以上(需把类似下面的注释解除即可)
    // if #available (iOS 8.0, *) { ... } 
    // @available(iOS 8.0, *) ...

    例:

    if #available(iOS 8.0, *) {
      KMRAlert(controller: self/* or nil */, title: "title", message: "message", type: .Alert)
                .addAction("1", act: {
                    print("1")
                })
                .addAction("2", action: { (_) in
                    print("2")
                })
                .addActionWithKey("woshishei", title: "6", actionStyle: .Default, action: {
                    print("6")
                })
                .addAction("3", actionStyle: .Destructive, action: {
                    print("3")
                })
                .addAction("4", enable: true, action: { _ in
                    print("4")
                })
                .addAction("5", actionStyle: .Default, enable: true, action: { (action) in
                    print(5)
                })
                .addTextFieldWithKey("textfield1", action: nil, changed: { _ in
                    print("textfield1")
                })
                .addTextField(nil, changed: { (_) in
                    print("textfield2")
                })
                .removeActionWithKey("woshishei")
                .removeTextFieldWithKey("textfield1")
                .show()
    }

Latest podspec

{
    "name": "KMRAlert",
    "version": "1.0.8",
    "summary": "Encapsulates the UIAlertController UIAlertView, UIActionSheet",
    "homepage": "https://github.com/kagenMonster/KMRAlert",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "kagenMonster": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/kagenMonster/KMRAlert.git",
        "tag": "1.0.8"
    },
    "source_files": "KMRAlert/KMRAlert/*.{h,m,swift}",
    "requires_arc": true
}

Pin It on Pinterest

Share This