ZKAlertView 2.0

ZKAlertView 2.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最新发布2017年11月
SPM支持 SPM

WangWenzhuang 维护。



  • 作者
  • WangWenzhuang

(logo)

ZKAlertView

license
build
CocoaPods
platform

封装了 UIAlertView,简单易用,支持 Block 回调,丢弃各种 tag。

实现功能

  • 可选性显示标题
  • 自定义显示按钮
  • 回调

运行环境

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