<!--
{
  "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:format:label:onEditingChanged:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI7StepperV5value4step6format5label16onEditingChangedACyxGAA7BindingVy11FormatInputQyd__G_AL_6StrideQYd__qd__xyXEySbctc10Foundation09ParseableL5StyleRd__SBAMRQSS0L6OutputRtd__lufc"
  },
  "title" : "init(value:step:format:label:onEditingChanged:)"
}
-->

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

Creates a stepper configured to increment or decrement a binding to a
value using a step value you provide, displaying its value with an
applied format style.

```
nonisolated init<F>(value: Binding<F.FormatInput>, step: F.FormatInput.Stride = 1, format: F, @ContentBuilder label: () -> Label, onEditingChanged: @escaping (Bool) -> Void = { _ in }) where F : ParseableFormatStyle, F.FormatInput : BinaryFloatingPoint, F.FormatOutput == String
```

## Parameters

`value`

The [`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 increment or decrement buttons.
Defaults to `1`.

`format`

A format style of type `F` to use when converting between
the string the user edits and the underlying value of type
`F.FormatInput`. If `format` can’t perform the conversion, the
stepper leaves `value` unchanged. If the user stops editing the
text in an invalid state, the stepper updates the text to the last
known valid value.

`label`

A view describing the purpose of this stepper.

`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 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, while displaying the
current value.

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.0
    private let step = 5.0

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

![A view displaying a stepper that increments or decrements a value by](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)