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

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

Creates a slider to select a value from a given range, subject to a step increment.

## Declaration

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

## Parameters

- `value`: The selected value within bounds.
- `bounds`: The range of the valid values.
- `step`: The distance between each valid value.
- `onEditingChanged`: A callback for when editing begins and ends.

## Discussion

Discussion The value of the created instance is equal to the position of the given value within bounds, mapped into 0...1. The slider calls onEditingChanged when editing begins and ends. For example, on iOS, editing begins when the user starts to drag the thumb along the slider’s track.

## See Also

### Creating a slider

- [init(value:in:onEditingChanged:)](swiftui/slider/init(value:in:oneditingchanged:).md)
