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

# rightViewRect(forBounds:)

Returns the drawing location of the text field’s right overlay view.

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

## Parameters

`bounds`

The bounding rectangle of the receiver.

## Return Value

The rectangle in which to draw the right overlay view.

## Discussion

You should not call this method directly. If you want to place the right overlay view in a different location, you can override this method and return the new rectangle. Note that the drawing rectangle remains unchanged in a right-to-left user interface.

---

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)