EmptyPluginImpl

@MainActor
open class EmptyPluginImpl : NSObject, EmptyPlugin, @unchecked Sendable

默认空界面插件

Accessor

  • 单例模式

    Declaration

    Swift

    @objc(sharedInstance)
    @MainActor
    public static let shared: EmptyPluginImpl
  • 显示空界面时是否执行淡入动画,默认YES

    Declaration

    Swift

    @MainActor
    open var fadeAnimated: Bool
  • 空界面自定义句柄,show方法自动调用

    Declaration

    Swift

    @MainActor
    open var customBlock: (@MainActor @Sendable (PlaceholderView) -> Void)?
  • 默认空界面文本句柄,非loading时才触发

    Declaration

    Swift

    @MainActor
    open var defaultText: (@MainActor @Sendable () -> AttributedStringParameter?)?
  • 默认空界面详细文本句柄,非loading时才触发

    Declaration

    Swift

    @MainActor
    open var defaultDetail: (@MainActor @Sendable () -> AttributedStringParameter?)?
  • 默认空界面图片句柄,非loading时才触发

    Declaration

    Swift

    @MainActor
    open var defaultImage: (@MainActor @Sendable () -> UIImage?)?
  • 默认空界面动作按钮句柄,非loading时才触发

    Declaration

    Swift

    @MainActor
    open var defaultAction: (@MainActor @Sendable () -> AttributedStringParameter?)?
  • 错误空界面文本格式化句柄,error生效,默认nil

    Declaration

    Swift

    @MainActor
    open var errorTextFormatter: (@MainActor @Sendable (Error?) -> AttributedStringParameter?)?
  • 错误空界面详细文本格式化句柄,error生效,默认nil

    Declaration

    Swift

    @MainActor
    open var errorDetailFormatter: (@MainActor @Sendable (Error?) -> AttributedStringParameter?)?
  • 错误空界面图片格式化句柄,error生效,默认nil

    Declaration

    Swift

    @MainActor
    open var errorImageFormatter: (@MainActor @Sendable (Error?) -> UIImage?)?
  • 错误空界面动作按钮格式化句柄,error生效,默认nil

    Declaration

    Swift

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

EmptyPlugin

  • Declaration

    Swift

    @MainActor
    open func showEmptyView(
        text: NSAttributedString?,
        detail: NSAttributedString?,
        image: UIImage?,
        loading: Bool,
        actions: [NSAttributedString]?,
        block: (@MainActor @Sendable (Int, Any) -> Void)?,
        customBlock: (@MainActor @Sendable (Any) -> Void)?,
        in view: UIView
    )
  • Declaration

    Swift

    @MainActor
    open func hideEmptyView(in view: UIView)
  • Declaration

    Swift

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