AlertPlugin
@MainActor
public protocol AlertPlugin : AnyObject
弹窗插件协议,应用可自定义弹窗实现
-
showAlert(title:
Default implementationmessage: style: cancel: actions: promptCount: promptBlock: actionBlock: cancelBlock: customBlock: in: ) 显示弹出框插件方法,默认使用系统UIAlertController
Default Implementation
显示弹出框插件方法,默认使用系统UIAlertController
Declaration
Swift
@MainActor func showAlert( title: AttributedStringParameter?, message: AttributedStringParameter?, style: AlertStyle, cancel: AttributedStringParameter?, actions: [AttributedStringParameter]?, promptCount: Int, promptBlock: (@MainActor @Sendable (_ textField: UITextField, _ index: Int) -> Void)?, actionBlock: (@MainActor @Sendable (_ values: [String], _ index: Int) -> Void)?, cancelBlock: (@MainActor @Sendable () -> Void)?, customBlock: (@MainActor @Sendable (_ alertController: Any) -> Void)?, in viewController: UIViewController )
-
showSheet(title:
Default implementationmessage: cancel: actions: currentIndex: actionBlock: cancelBlock: customBlock: in: ) 显示操作表插件方法,默认使用系统UIAlertController
Default Implementation
显示操作表插件方法,默认使用系统UIAlertController
Declaration
Swift
@MainActor func showSheet( title: AttributedStringParameter?, message: AttributedStringParameter?, cancel: AttributedStringParameter?, actions: [AttributedStringParameter]?, currentIndex: Int, actionBlock: (@MainActor @Sendable (_ index: Int) -> Void)?, cancelBlock: (@MainActor @Sendable () -> Void)?, customBlock: (@MainActor @Sendable (_ alertController: Any) -> Void)?, in viewController: UIViewController )
-
hideAlert(animated:
Default implementationcompletion: in: ) 手工隐藏弹出框插件方法,默认查找UIAlertController|AlertController
Default Implementation
手工隐藏弹出框插件方法,默认查找UIAlertController|AlertController
Declaration
Swift
@MainActor func hideAlert( animated: Bool, completion: (@MainActor @Sendable () -> Void)?, in viewController: UIViewController )
-
isShowingAlert(in:
Default implementation) 判断是否正在显示弹出框插件方法,默认查找UIAlertController|AlertController
Default Implementation
判断是否正在显示弹出框插件方法,默认查找UIAlertController|AlertController
Declaration
Swift
@MainActor func isShowingAlert(in viewController: UIViewController) -> Bool