使用 Swift 编写的简单 Alert View,可以用作 UIAlertController 的替代品。
它支持从 iOS7 开始!它简单且易于自定义!
DOAlertController 可以用作 UIAlertController
。
// Set title, message and alert style
let alertController = DOAlertController(title: "title", message: "message", preferredStyle: .Alert)
// Create the action.
let cancelAction = DOAlertAction(title: "OK", style: .Cancel) { action in
NSLog("The simple alert's cancel action occured.")
}
// Add the action.
alertController.addAction(cancelAction)
presentViewController(alertController, animated: true, completion: nil)
查看 DOAlertController-DEMO 了解详细信息
DOAlertController 通过 CocoaPods 提供。
为了安装,请将以下行添加到您的 Podfile 中
pod 'DOAlertController'
此软件是根据 MIT 许可证发布的,请参阅 LICENSE.txt。