Generic Initializer

init(value:in:step:onEditingChanged:label:)

Creates an instance configured to increment and decrement value by units of step and clamped to bounds.

Declaration

init<V>(value: Binding<V>, in bounds: ClosedRange<V>, step: V.Stride = 1, onEditingChanged: @escaping (Bool) -> Void = { _ in }, @ViewBuilder label: () -> Label) where V : Strideable

Discussion

onIncrement will be initialized to nil if attempting to increment value will have no effect. Likewise, onDecrement will be initialized to nil if attempting to decrement value will have no effect.