Properties and Binding

  • Represents a property, which exposes a value and allows observers to see when that value has changed.

    See more

    Declaration

    Swift

    public protocol ReadablePropertyType : AnyObject
  • A concrete property that is readable and observable.

    See more

    Declaration

    Swift

    open class ReadableProperty<T> : ReadablePropertyType
  • A concrete property that can be updated when bound to another property.

    See more

    Declaration

    Swift

    open class BindableProperty<T>
  • A concrete property that can be updated, but not read from.

    See more

    Declaration

    Swift

    open class WriteOnlyProperty<T> : BindableProperty<T>
  • Base class for properties that can be both read from and written to, i.e. is capable of bidirectional binding.

    See more

    Declaration

    Swift

    open class ReadWriteProperty<T> : BindableProperty<T>, ReadablePropertyType
  • A concrete read/write property whose value can be mutated directly.

    See more

    Declaration

    Swift

    public final class MutableValueProperty<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.

    See more

    Declaration

    Swift

    public final class ExternalValueProperty<T> : ReadWriteProperty<T>
  • A convenience form of WriteOnlyProperty that allows a given function to be called whenever a new value is delivered through a binding. This allows for use of the ~~> operator that allows for setting up a binding between a UI control that produces momentary events (e.g. UIButton clicks) and an ActionProperty that wraps an event handler.

    See more

    Declaration

    Swift

    public class ActionProperty<T> : WriteOnlyProperty<T>
  • A handle to a binding that is established by one of the bind or connect methods.

    See more

    Declaration

    Swift

    public class Binding
  • Describes the result of a connectBidi transformation.

    See more

    Declaration

    Swift

    public enum ChangeResult<T>
  • Establishes a unidirectional binding between lhs and rhs. When the value of the synchronous rhs property changes, the value of lhs will be updated.

    Declaration

    Swift

    @discardableResult
    public func <~ <T, RHS>(lhs: BindableProperty<T>, rhs: RHS) -> Binding where T == RHS.Value, RHS : ReadablePropertyType
  • Establishes a unidirectional binding between lhs and rhs. When the value of the asynchronous rhs property changes, the value of lhs will be updated.

    Declaration

    Swift

    @discardableResult
    public func <~ <T, RHS>(lhs: BindableProperty<T>, rhs: RHS) -> Binding where T == RHS.SignalChange, RHS : AsyncReadablePropertyType, RHS.SignalChange == RHS.Value
  • Establishes a bidirectional binding between the two properties. When one property’s value changes, the other property’s value will be updated and vice versa. Note that using this operator will cause the lhs property to take on the the rhs property’s value immedately.

    Declaration

    Swift

    @discardableResult
    public func <~> <T>(lhs: ReadWriteProperty<T>, rhs: ReadWriteProperty<T>) -> Binding
  • Establishes a bidirectional binding between the two properties. When one property’s value changes, the other property’s value will be updated and vice versa. Note that using this operator will cause the lhs property to take on the the rhs property’s value immedately (if the value is defined).

    Declaration

    Swift

    @discardableResult
    public func <~> <T>(lhs: ReadWriteProperty<T>, rhs: AsyncReadWriteProperty<T>) -> Binding
  • Establishes a unidirectional binding such that rhs is poked whenever lhs delivers a new value.

    Declaration

    Swift

    @discardableResult
    public func ~~> <T>(lhs: Signal<T>, rhs: ActionProperty<T>) -> Binding
  • Works in conjunction with will-change and did-change notifications that are delivered to a UI control when an associated Property’s underlying value is changing asynchronously.

    See more

    Declaration

    Swift

    public class ChangeHandler