EventViewProtocol

@MainActor
public protocol EventViewProtocol

通用事件视图协议,可选使用

Available where Self: UIView

  • eventDelegate Extension method

    弱引用事件代理

    Declaration

    Swift

    @MainActor
    public weak var eventDelegate: EventViewDelegate? { get nonmutating set }
  • eventTriggered Extension method

    事件已触发句柄,同eventDelegate.eventTriggered方法,句柄方式

    Declaration

    Swift

    @MainActor
    public var eventTriggered: ((Notification) -> Void)? { get nonmutating set }
  • triggerEvent(_:) Extension method

    触发指定事件,通知代理,参数为通知对象

    Declaration

    Swift

    @MainActor
    public func triggerEvent(_ event: Notification)
  • 触发指定事件,通知代理,可附带对象和用户信息

    Declaration

    Swift

    @MainActor
    public func triggerEvent(_ name: Notification.Name, object: Any? = nil, userInfo: [AnyHashable : Any]? = nil)