EventViewProtocol
@MainActor
public protocol EventViewProtocol
通用事件视图协议,可选使用
-
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)
-
triggerEvent(_:
Extension methodobject: userInfo: ) 触发指定事件,通知代理,可附带对象和用户信息
Declaration
Swift
@MainActor public func triggerEvent(_ name: Notification.Name, object: Any? = nil, userInfo: [AnyHashable : Any]? = nil)