AlertControllerImpl

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

自定义弹窗插件

Accessor

  • 单例模式

    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)?

AlertPlugin

Public