CatAlertController 0.1.1

CatAlertController 0.1.1

Kcat 维护。



Logo

Language Support Platform License

Carthage compatible CocoaPods Version

Travis CI Status Codebeat Beerpay

描述

CatAlertControllerUIAlertController 的一个高级管理对象。

要求

  • Swift 4+
  • iOS 8.0+

用法

以下是 iPhone 中的警告样式示例代码

CatAlertController(title: "CatAlertController", 
                    message: "This is CatAlertController", 
                    preferredStyle: UIAlertControllerStyle.alert)
                    .addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil))
                    .addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
                    .flash(from: self, animated: true, delay: 0.3, completion: nil)

以下是 iPad 中的动作表样式示例代码

// Don't worry the action sheet style present in iPad, it won't be crash, take it easy :)
CatAlertController(title: "Action Sheet Style", 
                    message: "This is CatAlertController", 
                    preferredStyle: UIAlertControllerStyle.actionSheet)
                    .addAction(UIAlertAction(title: "Item 1", style: UIAlertActionStyle.default, handler: nil))
                    .addAction(UIAlertAction(title: "Item 2", style: UIAlertActionStyle.default, handler: nil))
                    .addAction(UIAlertAction(title: "Item 3", style: UIAlertActionStyle.default, handler: nil))
                    .addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil))
                    .flash(from: self, animated: true, delay: 1, completion: nil)

许可证

CatAlertController 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。