AlertControllerImpl
open class AlertControllerImpl : NSObject, AlertPlugin
自定义弹窗插件
-
单例模式
Declaration
Swift
@objc(sharedInstance) public static let shared: AlertControllerImpl
-
自定义Alert弹窗样式,nil时使用单例
Declaration
Swift
open var customAlertAppearance: AlertControllerAppearance?
-
自定义ActionSheet弹窗样式,nil时使用单例
Declaration
Swift
open var customSheetAppearance: AlertControllerAppearance?
-
点击暗色背景关闭时是否触发cancelBlock,默认NO
Declaration
Swift
open var dimmingTriggerCancel: Bool
-
是否隐藏ActionSheet取消按钮,取消后可点击背景关闭并触发cancelBlock
Declaration
Swift
open var hidesSheetCancel: Bool
-
弹窗自定义句柄,show方法自动调用
Declaration
Swift
open var customBlock: ((AlertController) -> Void)?
-
showAlert(title:
message: style: cancel: actions: promptCount: promptBlock: actionBlock: cancelBlock: customBlock: in: ) Declaration
Swift
open func showAlert(title: AttributedStringParameter?, message: AttributedStringParameter?, style: AlertStyle, cancel: AttributedStringParameter?, actions: [AttributedStringParameter]?, promptCount: Int, promptBlock: ((UITextField, Int) -> Void)?, actionBlock: (([String], Int) -> Void)?, cancelBlock: (() -> Void)?, customBlock: ((Any) -> Void)? = nil, in viewController: UIViewController)
-
Declaration
Swift
open func showSheet(title: AttributedStringParameter?, message: AttributedStringParameter?, cancel: AttributedStringParameter?, actions: [AttributedStringParameter]?, currentIndex: Int, actionBlock: ((Int) -> Void)?, cancelBlock: (() -> Void)?, customBlock: ((Any) -> Void)? = nil, in viewController: UIViewController)
-
显示自定义视图弹窗,无默认按钮
Declaration
Swift
open func showAlert(style: UIAlertController.Style, headerView: UIView, cancel: AttributedStringParameter?, actions: [AttributedStringParameter]?, actionBlock: ((Int) -> Void)?, cancelBlock: (() -> Void)?, customBlock: ((Any) -> Void)? = nil, in viewController: UIViewController)