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

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

Creates a stepper with a title and configured to increment and decrement a binding to a value and step amount you provide.

## Declaration

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

## Parameters

- `title`: A string describing the purpose of the stepper.
- `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 button, respectively. 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.

## Discussion

Discussion Use Stepper(_:value:step:onEditingChanged:) to create a stepper with a custom title that increments or decrements a binding to value by the step size you specify. In the example below, the stepper increments or decrements the binding value by 5 each time one of the user clicks or taps the control’s increment or decrement buttons: struct StepperView: View {     @State private var value = 1     let step = 5     let title: String

var body: some View {         Stepper(title, value: $value, step: step)             .padding(10)     } }

## See Also

### Creating a stepper

- [init(value:step:label:onEditingChanged:)](swiftui/stepper/init(value:step:label:oneditingchanged:).md)
- [init(value:step:format:label:onEditingChanged:)](swiftui/stepper/init(value:step:format:label:oneditingchanged:).md)
- [init(_:value:step:format:onEditingChanged:)](swiftui/stepper/init(_:value:step:format:oneditingchanged:).md)
