---
title: UITextSelectionHighlightView
framework: uikit
role: symbol
role_heading: Protocol
path: uikit/uitextselectionhighlightview
---

# UITextSelectionHighlightView

An interface you use to provide a custom highlight UI behind the selected text.

## Declaration

```swift
@MainActor protocol UITextSelectionHighlightView : UICoordinateSpace
```

## Overview

Overview Adopt the UITextSelectionHighlightView protocol in a custom view you use to draw the highlight behind text in one of your text views. Use your custom view in conjunction with a UITextSelectionDisplayInteraction object to apply your custom selection UI to one of your text views. This protocol provides the rectangles for your view to fill with the highlight color and appearance. Use CALayer objects or your view’s draw(_:) method to draw these rectangles. After adopting this protocol in your custom view, assign your view to the highlightView property of the interaction object you attached to your text view.

## Topics

### Getting the rectangles to draw

- [selectionRects](uikit/uitextselectionhighlightview/selectionrects.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [UICoordinateSpace](uikit/uicoordinatespace.md)

## See Also

### Custom text selection

- [Adopting system selection UI in custom text views](uikit/adopting-system-selection-ui-in-custom-text-views.md)
- [UITextSelectionDisplayInteraction](uikit/uitextselectiondisplayinteraction.md)
- [UITextSelectionHandleView](uikit/uitextselectionhandleview.md)
- [UITextCursorView](uikit/uitextcursorview.md)
- [UIStandardTextCursorView](uikit/uistandardtextcursorview.md)
- [UITextCursorDropPositionAnimator](uikit/uitextcursordroppositionanimator.md)
- [UITextLoupeSession](uikit/uitextloupesession.md)
