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