CKAlertView
用法
简单的使用方式,调用如下代码就可以显示你要的弹出框,具体用法参考示例
let alert = CKAlertView(title: "无法安装‘爱奇艺视频播放’,因苹果系统的限制您可以选择如下方法解决", message: ["Swift 是一门进行iOS新语言"], cancelButtonTitle: "确定", otherButtonTitles: nil){ index in
self.lblMessage.text = "One button alert dismissed"
}
alert.show()
弹出样式
提供多种样式的弹出框,尽量使用少的代码来扩展弹出样式。目前支持的样式如下:
显示自定义弹出框:
扩展:
备注
- 监听值类型请继承CKAlertView,参考CKCircularProgressAlertView
release
- 0.1.4 显示自定义的弹出框
- 0.1.6 所有文字可以用NSAttributeString或者String来控制文字格式。
- 0.3.3 修改很大,增加了动画效果和新手势,增加了config用于弹出框样式配置,CKAlertViewConfiguration.shared()用于全局配置,影响所有弹出框。可以将CKAlertViewConfiguration实例赋给CKAlertView,以改变具体单个弹出框的样式。
- 0.4.0 更新到Swift 4。
安装
CKAlertView可以通过CocoaPods获取。要安装,只需将以下行添加到您的Podfile中
pod "CKAlertView", :git=>"https://github.com/kaich/CKAlertView.git"
如果想要包含'Extension'模块,请按照以下方式安装。
pod "CKAlertView", :subspecs => ['Core','Extension'], :git=>"https://github.com/kaich/CKAlertView.git"
作者
kaich, [email protected]
许可证
CKAlertView在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。