<!--
{
  "availability" : [
    "iOS: 2.0.0 - 15.0.0",
    "iPadOS: 2.0.0 - 15.0.0",
    "macCatalyst: 13.1.0 - 15.0.0",
    "tvOS: 2.0.0 - 15.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIButton/contentRect(forBounds:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIButton(im)contentRectForBounds:"
  },
  "title" : "contentRect(forBounds:)"
}
-->

# contentRect(forBounds:)

Returns the rectangle in which the receiver draws its entire content.

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

## Parameters

`bounds`

The bounding rectangle for the receiver.

## Return Value

The rectangle in which the receiver draws its entire content.

## Discussion

The content rectangle is the area needed to display the image and title including any padding and adjustments for alignment and other settings.

## See Also

[`contentEdgeInsets`](/documentation/UIKit/UIButton/contentEdgeInsets)

The inset or outset margins for the rectangle surrounding all of the button’s content.



---

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)