<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPVolumeView/volumeSliderRect(forBounds:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPVolumeView(im)volumeSliderRectForBounds:"
  },
  "title" : "volumeSliderRect(forBounds:)"
}
-->

# volumeSliderRect(forBounds:)

Returns the drawing rectangle for the slider’s track.

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

## Parameters

`bounds`

The bounding rectangle of the receiver.

## 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

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

---

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)