ExternalValueProperty

public final class ExternalValueProperty<T> : ReadWriteProperty<T>

A read/write property whose storage is maintained external to the property. This is mainly useful for compatibility with existing UI frameworks. For example, an ExternalValueProperty may be used to add binding support to an existing AppKit control, such as the stringValue property of NSTextField.

  • Undocumented

    Declaration

    Swift

    public typealias Getter = () -> T
  • When true, any changes supplied by a bound property will be ignored. This is mainly useful when a UI control has the concept of edit mode (e.g. a text field) and is primarily supplying values to a bidirectionally-bound property but is not likely to receive values from that property while in edit mode.

    Declaration

    Swift

    public var exclusiveMode: Bool
  • Undocumented

    Declaration

    Swift

    public init(get: @escaping Getter, set: @escaping Setter, changeHandler: ChangeHandler = ChangeHandler())
  • Called to notify observers that the underlying external value has been changed.

    Declaration

    Swift

    public func changed(transient: Bool)