---
title: "trackRect(forBounds:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uislider/trackrect(forbounds:)"
---

# trackRect(forBounds:)

Returns the drawing rectangle for the slider’s track.

## Declaration

```swift
func trackRect(forBounds bounds: CGRect) -> CGRect
```

## Parameters

- `bounds`: The bounding rectangle of the slider.

## Return Value

Return Value The computed drawing rectangle for the track. This rectangle corresponds to the entire length of the track between the minimum and maximum value images.

## Discussion

Discussion You do not call this method directly. Instead, you override it when you want to customize the track rectangle, returning a different rectangle. The returned rectangle is used to scale the track and thumb images during drawing.

## See Also

### Overrides for subclasses

- [maximumValueImageRect(forBounds:)](uikit/uislider/maximumvalueimagerect(forbounds:).md)
- [minimumValueImageRect(forBounds:)](uikit/uislider/minimumvalueimagerect(forbounds:).md)
- [thumbRect(forBounds:trackRect:value:)](uikit/uislider/thumbrect(forbounds:trackrect:value:).md)
