<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISlider/setThumbImage(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISlider(im)setThumbImage:forState:"
  },
  "title" : "setThumbImage(_:for:)"
}
-->

# setThumbImage(_:for:)

Assigns a thumb image to the specified control states.

```
func setThumbImage(_ image: UIImage?, for state: UIControl.State)
```

## Parameters

`image`

The thumb image to associate with the specified states.

`state`

The control state with which to associate the image.

## Discussion

When you specify a custom thumb image, the slider ignores the custom thumb tint color, if any.

Sliders respond to user interaction with dynamic effects and appearance. If you use images to customize the appearance of the track, then the slider doesn’t apply the dynamic effects or alter the appearance.

> Important:
> This method isn’t available when the user interface idiom is ``doc://com.apple.uikit/documentation/UIKit/UIUserInterfaceIdiom/mac`` and ``doc://com.apple.uikit/documentation/UIKit/UISlider/behavioralStyle`` is ``doc://com.apple.uikit/documentation/UIKit/UIBehavioralStyle/mac`` — calling it while in this state throws an exception.

---

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)