AlertPluginImpl

@MainActor
open class AlertPluginImpl : NSObject, AlertPlugin, @unchecked Sendable

默认弹窗插件

Accessor

  • 单例模式

    Declaration

    Swift

    @objc(sharedInstance)
    @MainActor
    public static let shared: AlertPluginImpl
  • 自定义Alert弹窗样式,nil时使用单例

    Declaration

    Swift

    @MainActor
    open var customAlertAppearance: AlertAppearance?
  • 自定义ActionSheet弹窗样式,nil时使用单例

    Declaration

    Swift

    @MainActor
    open var customSheetAppearance: AlertAppearance?
  • 自定义弹窗类数组,默认nil时查找UIAlertController|AlertController

    Declaration

    Swift

    @MainActor
    open var customAlertClasses: [AnyClass]?
  • 弹窗自定义句柄,show方法自动调用

    Declaration

    Swift

    @MainActor
    open var customBlock: (@MainActor @Sendable (UIAlertController) -> Void)?
  • 默认close按钮文本句柄,alert单按钮或sheet单取消生效。未设置时为关闭

    Declaration

    Swift

    @MainActor
    open var defaultCloseButton: (@MainActor @Sendable (UIAlertController.Style) -> AttributedStringParameter?)?
  • 默认cancel按钮文本句柄,alert多按钮或sheet生效。未设置时为取消

    Declaration

    Swift

    @MainActor
    open var defaultCancelButton: (@MainActor @Sendable (UIAlertController.Style) -> AttributedStringParameter?)?
  • 默认confirm按钮文本句柄,alert多按钮生效。未设置时为确定

    Declaration

    Swift

    @MainActor
    open var defaultConfirmButton: (@MainActor @Sendable () -> AttributedStringParameter?)?
  • 错误标题格式化句柄,error生效,默认nil

    Declaration

    Swift

    @MainActor
    open var errorTitleFormatter: (@MainActor @Sendable (Error?) -> AttributedStringParameter?)?
  • 错误消息格式化句柄,error生效,默认nil

    Declaration

    Swift

    @MainActor
    open var errorMessageFormatter: (@MainActor @Sendable (Error?) -> AttributedStringParameter?)?
  • 错误样式格式化句柄,error生效,默认nil

    Declaration

    Swift

    @MainActor
    open var errorStyleFormatter: (@MainActor @Sendable (Error?) -> AlertStyle)?
  • 错误按钮格式化句柄,error生效,默认nil

    Declaration

    Swift

    @MainActor
    open var errorButtonFormatter: (@MainActor @Sendable (Error?) -> AttributedStringParameter?)?

AlertPlugin