UITextSelectionRect Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 6.0 and later.
Declared in
UITextInput.h

Overview

The UITextSelectionRect class encapsulates information about a selected range of text in a document. 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.

Tasks

Accessing the Selection Rectangle

Accessing Text-Related Attributes

Determining the Selection Status

Properties

containsEnd

A Boolean value indicating whether the rectangle contains the end of the selection. (read-only)

@property (nonatomic, readonly) BOOL containsEnd
Discussion

The value of this property is used to determine the placement of the selection handles in bidirectional text. It provides a clue to the system about whether the end of the selection is in the specified rectangle.

Availability
  • Available in iOS 6.0 and later.
Declared In
UITextInput.h

containsStart

A Boolean value indicating whether the rectangle contains the start of the selection. (read-only)

@property (nonatomic, readonly) BOOL containsStart
Discussion

The value of this property is used to determine the placement of the selection handles in bidirectional text. It provides a clue to the system about whether the start of the selection is in the specified rectangle.

Availability
  • Available in iOS 6.0 and later.
Declared In
UITextInput.h

isVertical

A Boolean value indicating whether the text is oriented vertically. (read-only)

@property (nonatomic, readonly) BOOL isVertical
Availability
  • Available in iOS 6.0 and later.
Declared In
UITextInput.h

rect

The rectangle that encloses the receiver’s text range. (read-only)

@property (nonatomic, readonly) CGRect rect
Discussion

The returned rectangle is in the coordinate system of the text input view that created the receiver.

Availability
  • Available in iOS 6.0 and later.
Declared In
UITextInput.h

writingDirection

The writing direction of text in the receiver’s text range. (read-only)

@property (nonatomic, readonly) UITextWritingDirection writingDirection
Availability
  • Available in iOS 6.0 and later.
Declared In
UITextInput.h