UIAlertController
public extension UIAlertController
-
alert风格弹框
使用
UIAlertController.showAlert(title: "无法开启相机", message: "请在iPhone的“设置 - 隐私 - 相机”选项中,允许App访问相机。", actionItems: [ ActionItem(title: "去设置", style: .default, action: { }), ActionItem(title: "取消", style: .cancel, action: nil), ])
Declaration
Swift
static func showAlert(title: String? = nil, message: String? = nil, actionItems: [ActionItem])
Parameters
title
标题
message
消息
actionItems
选项
-
actionSheet风格弹框
使用
UIAlertController.showActionSheet(title: "选择证件照", actionItems: [ ActionItem(title: "拍照", style: .default, action: { }), ActionItem(title: "相册", style: .default, action: { }), ActionItem(title: "取消", style: .cancel, action: nil), ])
Declaration
Swift
static func showActionSheet(title: String? = nil, message: String? = nil, actionItems: [ActionItem])
Parameters
title
标题
message
信息
actionItems
选项