<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Stepper/init(_:value:step:onEditingChanged:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI7StepperVA2A4TextVRszrlE_5value4step16onEditingChangedACyAEG10Foundation23LocalizedStringResourceV_AA7BindingVyqd__G6StrideQyd__ySbctcSxRd__lufc::OverloadGroup"
  },
  "title" : "init(_:value:step:onEditingChanged:)"
}
-->

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

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

```
@export(implementation) nonisolated init<V>(_ titleResource: LocalizedStringResource, value: Binding<V>, step: V.Stride = 1, onEditingChanged: @escaping (Bool) -> Void = { _ in }) where V : Strideable
```

## Parameters

`titleResource`

Text resource for the stepper’s localized title
describing the purpose of the stepper.

`value`

A [`Binding`](/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 plus or minus 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

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 the user clicks or taps on the control’s
increment or decrement buttons, respectively:

```
struct StepperView: View {
    @State private var value = 1
    let step = 5

    var body: some View {
        Stepper("Current value: \(value), step: \(step)",
                value: $value,
                step: step)
            .padding(10)
    }
}
```

![A view displaying a stepper that increments or decrements by 5 each](images/com.apple.SwiftUI/SwiftUI-Stepper-value-step@2x.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)