Binding

@propertyWrapper
public struct Binding<Value>

A property wrapper type that can read and write a value owned by a source of truth.

  • The underlying value referenced by the binding variable.

    Declaration

    Swift

    public var wrappedValue: Value { get nonmutating set }
  • A projection of the binding value that returns a binding.

    Declaration

    Swift

    public var projectedValue: `Self` { get }
  • Creates a binding with closures that read and write the binding value.

    Declaration

    Swift

    public init(getValue: @escaping () -> Value, setValue: @escaping (Value) -> Void)