Latest 2.0
Homepage https://github.com/WangWenzhuang/ZKAlertView
License MIT
Platforms ios 8.0, requires ARC
Authors

(logo)

license
build
CocoaPods
platform

封装了 UIAlertView,简单易用,Block 回调,丢掉各种 tag

实现功能

  • [x] 标题选择性显示
  • [x] 按钮自定义显示
  • [x] 回调

运行环境

  • iOS 8.0 +
  • Xcode 8 +
  • Swift 3.0 +

安装

CocoaPods

你可以使用 CocoaPods 安装 ZKAlertView,在你的 Podfile 中添加:

platform :ios, '8.0'
use_frameworks!

target 'MyApp' do
    pod 'ZKAlertView'
end

手动安装

  • 拖动 ZKAlertView 文件夹到您的项目

快速使用

导入 ZKAlertView

import ZKAlertView

不显示标题,显示一个按钮

ZKAlertView.show(message: "不显示标题,显示一个按钮", buttonTitle: "确定")

显示标题,显示一个按钮

ZKAlertView.show("标题", message: "显示标题,显示一个按钮", buttonTitle: "确定")

不显示标题,显示一个按钮,包含回调

ZKAlertView.show(message: "不显示标题,显示一个按钮,包含回调", buttonTitle: "确定") {
    print("不显示标题,显示一个按钮,包含回调")
}

显示标题,显示一个按钮,包含回调

ZKAlertView.show("标题", message: "显示标题,显示一个按钮,包含回调", buttonTitle: "确定") {
    print("不显示标题,显示一个按钮,包含回调")
}

不显示标题,显示多个按钮,包含回调

ZKAlertView.show(message: "不显示标题,显示多个按钮,包含回调", cancleButtonTitle: "取消", otherButtonTitles: "按钮1", "按钮2") { (alertView, buttonIndex) in
    print("按钮点击索引:(buttonIndex)")
}

显示标题,显示多个按钮,包含回调

ZKAlertView.show("标题", message: "显示标题,显示多个按钮,包含回调", cancleButtonTitle: "取消", otherButtonTitles: "按钮1", "按钮2") { (alertView, buttonIndex) in
    print("按钮点击索引:(buttonIndex)")
}

Latest podspec

{
    "name": "ZKAlertView",
    "version": "2.0",
    "summary": "u5c01u88c5 UIAlertViewuff0cu7b80u5355u6613u7528uff0cBlock u56deu8c03uff0cu4e22u6389u5404u79cd tagu3002",
    "homepage": "https://github.com/WangWenzhuang/ZKAlertView",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "WangWenzhuang": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/WangWenzhuang/ZKAlertView.git",
        "tag": "2.0"
    },
    "source_files": "ZKAlertView/*.swift",
    "requires_arc": true,
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    }
}

Pin It on Pinterest

Share This