Event

@propertyWrapper
public class Event<T>

Property wrapper that can be used to define an event publisher/source pair using a single property.

When used as a property wrapper, events can be registered to with EventSource<T>.addListener(weakOwner:_:), and published with EventPublisher<T>.publishEvent(_:).

Warning: Not thread-safe.

Available where T == Void

  • Convenience for publishEvent(()).

    Declaration

    Swift

    func publishEvent()
  • Convenience for publishEvent(()).

    Declaration

    Swift

    func callAsFunction()