ToastPlugin

@MainActor
public protocol ToastPlugin : AnyObject

吐司插件协议,应用可自定义吐司插件实现

  • 显示加载吐司,默认需手工隐藏,指定cancelBlock时点击会自动隐藏并调用之

    Default Implementation

    默认实现,显示加载吐司,默认需手工隐藏,指定cancelBlock时点击会自动隐藏并调用之

    Declaration

    Swift

    @MainActor
    func showLoading(
        attributedText: NSAttributedString?,
        attributedDetail: NSAttributedString?,
        cancelBlock: (@MainActor @Sendable () -> Void)?,
        customBlock: (@MainActor @Sendable (Any) -> Void)?,
        in view: UIView
    )
  • hideLoading(delayed:in:) Default implementation

    隐藏加载吐司,可指定延迟隐藏从而实现连续的加载效果

    Default Implementation

    默认实现,隐藏加载吐司,可指定延迟隐藏从而实现连续的加载效果

    Declaration

    Swift

    @MainActor
    func hideLoading(delayed: Bool, in view: UIView)
  • showingLoadingView(in:) Default implementation

    获取正在显示的加载吐司视图

    Default Implementation

    默认实现,获取正在显示的加载吐司视图

    Declaration

    Swift

    @MainActor
    func showingLoadingView(in view: UIView) -> UIView?
  • 显示进度条吐司,默认需手工隐藏,指定cancelBlock时点击会自动隐藏并调用之

    Default Implementation

    默认实现,显示进度条吐司,默认需手工隐藏,指定cancelBlock时点击会自动隐藏并调用之

    Declaration

    Swift

    @MainActor
    func showProgress(
        attributedText: NSAttributedString?,
        attributedDetail: NSAttributedString?,
        progress: CGFloat,
        cancelBlock: (@MainActor @Sendable () -> Void)?,
        customBlock: (@MainActor @Sendable (Any) -> Void)?,
        in view: UIView
    )
  • hideProgress(in:) Default implementation

    隐藏进度条吐司

    Default Implementation

    默认实现,隐藏进度条吐司

    Declaration

    Swift

    @MainActor
    func hideProgress(in view: UIView)
  • showingProgressView(in:) Default implementation

    获取正在显示的进度条吐司视图

    Default Implementation

    默认实现,获取正在显示的进度条吐司视图

    Declaration

    Swift

    @MainActor
    func showingProgressView(in view: UIView) -> UIView?
  • 显示指定样式消息吐司,可设置自动隐藏和允许交互,自动隐藏完成后回调

    Default Implementation

    默认实现,显示指定样式消息吐司,可设置自动隐藏和允许交互,自动隐藏完成后回调

    Declaration

    Swift

    @MainActor
    func showMessage(
        attributedText: NSAttributedString?,
        attributedDetail: NSAttributedString?,
        style: ToastStyle,
        autoHide: Bool,
        interactive: Bool,
        completion: (@MainActor @Sendable () -> Void)?,
        customBlock: (@MainActor @Sendable (Any) -> Void)?,
        in view: UIView
    )
  • hideMessage(in:) Default implementation

    隐藏消息吐司

    Default Implementation

    默认实现,隐藏消息吐司

    Declaration

    Swift

    @MainActor
    func hideMessage(in view: UIView)
  • showingMessageView(in:) Default implementation

    获取正在显示的消息吐司视图

    Default Implementation

    默认实现,获取正在显示的消息吐司视图

    Declaration

    Swift

    @MainActor
    func showingMessageView(in view: UIView) -> UIView?