---
title: "setValue(_:)"
framework: watchkit
role: symbol
role_heading: Instance Method
path: "watchkit/wkinterfaceslider/setvalue(_:)"
---

# setValue(_:)

Changes the value of the slider.

## Declaration

```swift
func setValue(_ value: Float)
```

## Parameters

- `value`: The new value for the slider. If the new value is outside of the slider’s acceptable range, this method clamps the new value to the minimum or maximum value.

## See Also

### Related Documentation

- [App Programming Guide for watchOS](apple-archive/documentation/General/Conceptual/WatchKitProgrammingGuide.md)

### Setting the Slider Value

- [setColor(_:)](watchkit/wkinterfaceslider/setcolor(_:).md)
- [setNumberOfSteps(_:)](watchkit/wkinterfaceslider/setnumberofsteps(_:).md)
