<!--
{
  "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/rightView",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITextField(py)rightView"
  },
  "title" : "rightView"
}
-->

# rightView

The overlay view that displays on the right (or trailing) side of the text field.

```
var rightView: UIView? { get set }
```

## Discussion

You can use the right overlay view to provide indicate additional features available for the text field. For example, you might display a bookmarks button in this location to allow the user to select from a set of predefined items. The right overlay view flips automatically in a right-to-left user interface.

The right overlay view is placed in the rectangle returned by the [`rightViewRect(forBounds:)`](/documentation/UIKit/UITextField/rightViewRect(forBounds:)) method of the receiver. The image associated with this property should fit the given rectangle. If it does not fit, it is scaled to fit. If you specify a control for your view, that control tracks and sends actions as usual.

If your right overlay view overlaps a sibling view, such as the clear button, you must use the [`UITextField.ViewMode`](/documentation/UIKit/UITextField/ViewMode) to implement proper behavior. For example, if [`clearButtonMode`](/documentation/UIKit/UITextField/clearButtonMode) is set to display the clear button, you can set the right overlay view’s [`rightViewMode`](/documentation/UIKit/UITextField/rightViewMode) to [`UITextField.ViewMode.unlessEditing`](/documentation/UIKit/UITextField/ViewMode/unlessEditing) to reveal the clear button during editing when the text field has contents.

## See Also

[`-  rightViewRectForBounds:`](/documentation/UIKit/UITextField/rightViewRect(forBounds:))

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



---

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)