---
title: UITextSelectionRect
framework: uikit
role: symbol
role_heading: Class
path: uikit/uitextselectionrect
---

# UITextSelectionRect

An encapsulation of information about a selected range of text in a document.

## Declaration

```swift
@MainActor class UITextSelectionRect
```

## Overview

Overview This class is an abstract class and must be subclassed to be used. The system text input views provide their own concrete implementations of this class. Subclassing Notes If you are implementing a custom text input view, you can subclass and use your custom class to return selection-related information. When subclassing, you should override and reimplement all properties. In your custom implementations, do not call super.

## Topics

### Accessing the Selection Rectangle

- [rect](uikit/uitextselectionrect/rect.md)

### Accessing Text-Related Attributes

- [writingDirection](uikit/uitextselectionrect/writingdirection.md)
- [isVertical](uikit/uitextselectionrect/isvertical.md)

### Determining the Selection Status

- [containsStart](uikit/uitextselectionrect/containsstart.md)
- [containsEnd](uikit/uitextselectionrect/containsend.md)

### Instance Properties

- [transform](uikit/uitextselectionrect/transform.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)

## See Also

### Metrics

- [UITextPosition](uikit/uitextposition.md)
- [UITextRange](uikit/uitextrange.md)
