---
title: "init(value:step:onEditingChanged:label:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/stepper/init(value:step:oneditingchanged:label:)"
---

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

Creates a stepper configured to increment or decrement a binding to a value using a step value you provide.

## Declaration

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

## Parameters

- `value`: The doc://com.apple.SwiftUI/documentation/SwiftUI/Binding to a value that you provide.
- `step`: The amount to increment or decrement value each time the user clicks or taps the stepper’s increment or decrement buttons. Defaults to 1.
- `onEditingChanged`: A closure that’s called when editing begins and ends. For example, on iOS, the user may touch and hold the increment or decrement buttons on a stepper which causes the execution of the onEditingChanged closure at the start and end of the gesture.
- `label`: A view describing the purpose of this stepper.

## Discussion

Discussion Use this initializer to create a stepper that increments or decrements a bound value by a specific amount each time the user clicks or taps the stepper’s increment or decrement buttons. In the example below, a stepper increments or decrements value by the step value of 5 at each click or tap of the control’s increment or decrement button: struct StepperView: View {     @State private var value = 1     let step = 5     var body: some View {         Stepper(value: $value,                 step: step) {             Text("Current value: \(value), step: \(step)")         }             .padding(10)     } }

## See Also

### Deprecated initializers

- [init(value:in:step:onEditingChanged:label:)](swiftui/stepper/init(value:in:step:oneditingchanged:label:).md)
- [init(onIncrement:onDecrement:onEditingChanged:label:)](swiftui/stepper/init(onincrement:ondecrement:oneditingchanged:label:).md)
