袋UIAlertCotroller 以便于使用
只需将 EasyAlertController.swift 添加到您的项目中。
或者使用 CocoaPods 和 Podfile
pod 'EasyAlertController'
或者 Carthage 用户可以简单地将其添加到他们的 Cartfile
github "ober01/EasyAlertController"
let actionSheet = UIAlertController(title: "title", message: "message", preferredStyle: .ActionSheet)
let action = UIAlertAction(title: "default", style: .Default, handler: {_ in print("tap")})
let cancel = UIAlertAction(title: "cancel", style: .Cancel, handler: {_ in print("tap")})
let destructive = UIAlertAction(title: "action", style: .Destructive, handler: {_ in print("tap")})
actionSheet.addAction(action)
actionSheet.addAction(cancel)
actionSheet.addAction(destructive)
presentViewController(alert, animated:true, completion:nil)
let actionSheet = UIAlertController.actionSheet(actions: [
.Default(title: "Default", handler: { _ in print("tap")}),
.Destructive(title: "Destructive", handler: { _ in print("tap")}),
.Cancel(title: "Cancel", handler: nil)
])
EasyAlertController 以 MIT 许可证发布。有关详细信息,请参阅 LICENSE。
如有任何问题,请写信至 [email protected] 关注 @KalinkinAleksey