---
title: "volumeSliderRect(forBounds:)"
framework: mediaplayer
role: symbol
role_heading: Instance Method
path: "mediaplayer/mpvolumeview/volumesliderrect(forbounds:)"
---

# volumeSliderRect(forBounds:)

Returns the drawing rectangle for the slider’s track.

## Declaration

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

## Parameters

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

## Return Value

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

## Discussion

Discussion The system uses the rectangle to scale the track and thumb images during drawing.

## See Also

### Customizing the volume slider

- [maximumVolumeSliderImage(for:)](mediaplayer/mpvolumeview/maximumvolumesliderimage(for:).md)
- [minimumVolumeSliderImage(for:)](mediaplayer/mpvolumeview/minimumvolumesliderimage(for:).md)
- [setMaximumVolumeSliderImage(_:for:)](mediaplayer/mpvolumeview/setmaximumvolumesliderimage(_:for:).md)
- [setMinimumVolumeSliderImage(_:for:)](mediaplayer/mpvolumeview/setminimumvolumesliderimage(_:for:).md)
- [setVolumeThumbImage(_:for:)](mediaplayer/mpvolumeview/setvolumethumbimage(_:for:).md)
- [volumeThumbImage(for:)](mediaplayer/mpvolumeview/volumethumbimage(for:).md)
- [volumeThumbRect(forBounds:volumeSliderRect:value:)](mediaplayer/mpvolumeview/volumethumbrect(forbounds:volumesliderrect:value:).md)
