CancellableValueChangedEventArgs
public class CancellableValueChangedEventArgs<T>
An event argument set for an event that tracks changes to a property, while
exposing a cancel
that can be changed by clients to cancel the state change
-
A copy of the old value that was changed.
Declaration
Swift
public let oldValue: T
-
A copy of the new value that is being changed into.
Declaration
Swift
public let newValue: T
-
Variable that event handlers can use to mark this change event as ‘canceled’.
The semantics of a canceled value change event are handled by the event publisher, but is usually implied to cancel the change of the associated state to
newValue
.Multiple event listeners may toggle this value on and off as they take turns handling the event that this argument object accompanies, but only the last value
cancel
was attributed to is seen by event publishers upstream.Declaration
Swift
public var cancel: Bool
-
Undocumented
Declaration
Swift
public init(oldValue: T, newValue: T)