<!--
{
  "availability" : [
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WatchKit",
  "identifier" : "/documentation/WatchKit/WKInterfaceSlider",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "WatchKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKInterfaceSlider"
  },
  "title" : "WKInterfaceSlider"
}
-->

# WKInterfaceSlider

An interface element that lets users select a single floating-point value from a range of values.

```
class WKInterfaceSlider
```

## Overview

You configure the appearance of sliders in your storyboard file, including the images to display for the minimum and maximum value. At runtime, you use a slider object to enable the slider or set its value.

Do not subclass or create instances of this class yourself. Instead, define outlets in your interface controller class and connect them to the corresponding objects in your storyboard file. For example, to refer to a slider object in your interface, define a property with the following syntax in your interface controller class:

```objc
@property (weak, nonatomic) IBOutlet WKInterfaceSlider* mySlider;
```

During the initialization of your interface controller, WatchKit creates a new instance of this class and assigns it to your outlet. At that point, you can use the object in your outlet to make changes to the onscreen slider.

When the user changes the value of a slider, WatchKit delivers the new value to the slider’s action method. The format of a slider’s action method is as follows:

```objc
- (IBAction)sliderAction:(float)value
```

Declare a method of this form in the interface controller class used to receive the slider’s new value. You can change the method name to anything you like. When configuring the slider in Xcode, connect its selector to your custom action method.

### Interface Builder Configuration Options

Xcode lets you configure information about your slider in your storyboard file. The following table lists the attributes you can configure in your storyboard and their meaning.

|Attribute |Description                                                                                                                                                                                                                        |
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|Value     |The initial numerical value of the slider. This value must be between the specified minimum and maximum values. Clicking the slider buttons decreases or increases the current value until it reaches the minimum or maximum value.|
|Minimum   |The smallest numerical value allowed by the slider.                                                                                                                                                                                |
|Maximum   |The largest numerical value allowed by the slider.                                                                                                                                                                                 |
|Steps     |The number of steps between the minimum and maximum values. The slider uses the number of steps to determine how much to increment or decrement the value when the user interacts with the slider controls.                        |
|Continuous|The display style for the slider. When enabled, the slider value displays its value using a solid bar. When disabled, the slider displays its value using discrete steps.                                                          |
|Color     |The color of the slider bar. You can also set the color programmatically using the ``doc://com.apple.watchkit/documentation/WatchKit/WKInterfaceSlider/setColor(_:)`` method.                                                      |
|Min Image |The name of the image to display next to the minimum value of the slider. This image must be bundled in the WatchKit app.                                                                                                          |
|Max Image |The name of the image to display next to the maximum value of the slider. This image must be bundled with your WatchKit app.                                                                                                       |
|Enabled   |A checkbox indicating whether the slider is enabled and whether it sends events when its value changes.                                                                                                                            |

## Topics

### Setting the Slider Value

[`-  setValue:`](/documentation/WatchKit/WKInterfaceSlider/setValue(_:))

Changes the value of the slider.

[`-  setColor:`](/documentation/WatchKit/WKInterfaceSlider/setColor(_:))

Sets the color of the slider bar.

[`-  setNumberOfSteps:`](/documentation/WatchKit/WKInterfaceSlider/setNumberOfSteps(_:))

Sets the number of steps for the slider.

### Enabling the Slider

[`-  setEnabled:`](/documentation/WatchKit/WKInterfaceSlider/setEnabled(_:))

Enables or disables the slider.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`WKInterfaceObject`](/documentation/WatchKit/WKInterfaceObject)

---

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)