Binding

extension Binding
  • Perform an action when a value is changed.

    Declaration

    Swift

    func onChange(_ handler: @escaping (Value) -> Void) -> Binding<Value>

    Parameters

    handler

    An escaping closure that executes when a value is set.

    Return Value

    The binding with the changed value.