Inherits from UIView
Declared in DTTextSelectionView.h

Overview

A view that shows selection rectangles for an editor.

Tasks

Creating a Selection View

Accessing Subviews

Customizing the Look

Working with Selection Rectangles

Working with Drag Handles

Getting Information

Layout

Properties

cursorColor

The caret color to use next to the ranged selection drag handles

@property (nonatomic, retain) UIColor *cursorColor

Declared In

DTTextSelectionView.h

dragHandleLeft

The image view that represents the left drag handle.

@property (nonatomic, retain) UIImageView *dragHandleLeft

Declared In

DTTextSelectionView.h

dragHandleRight

The image view that represents the right drag handle.

@property (nonatomic, retain) UIImageView *dragHandleRight

Declared In

DTTextSelectionView.h

dragHandlesVisible

Specifies whether the drag handles are visible

@property (nonatomic, assign) BOOL dragHandlesVisible

Declared In

DTTextSelectionView.h

selectionRectangles

The selection rectangles to display in the receiver

@property (nonatomic, retain) NSArray *selectionRectangles

Declared In

DTTextSelectionView.h

style

The current selection style of the receiver.

@property (nonatomic, assign) DTTextSelectionStyle style

Discussion

Support are blue selection and green marking style.

  • DTTextSelectionStyleSelection
  • DTTextSelectionStyleMarking

Declared In

DTTextSelectionView.h

textView

The text view that the receiver belongs to

@property (nonatomic, readonly) UIView *textView

Declared In

DTTextSelectionView.h

Instance Methods

beginCaretRect

The frame rectangle of the beginning caret of a selected range

- (CGRect)beginCaretRect

Declared In

DTTextSelectionView.h

endCaretRect

The frame rectangle of the ending caret of a selected range

- (CGRect)endCaretRect

Declared In

DTTextSelectionView.h

initWithTextView:

Designated Initializer. Creates a selection view for a given text view

- (id)initWithTextView:(UIView *)view

Parameters

view

The text view that this selection view shows selections for

Return Value

An initialized selection view

Declared In

DTTextSelectionView.h

layoutSubviewsInRect:

Lays out the subviews of the receiver with a provided visible rectangle

- (void)layoutSubviewsInRect:(CGRect)rect

Parameters

rect

The rectangle in which to lay out the subviews

Declared In

DTTextSelectionView.h

selectionEnvelope

A frame rectangle the envelops the entire selection

- (CGRect)selectionEnvelope

Declared In

DTTextSelectionView.h

setDragHandlesVisible:animated:

Customized setter to optionally show/hide the drag handles with a fading animation

- (void)setDragHandlesVisible:(BOOL)dragHandlesVisible animated:(BOOL)animated

Parameters

dragHandlesVisible

YES to make the drag handles visible, NO to hide them

animated

Whether the change of visibility of the drag handles should be animated

Declared In

DTTextSelectionView.h

setSelectionRectangles:animated:

Customized setter for selectionRectangles that optionally animates the selection change

- (void)setSelectionRectangles:(NSArray *)selectionRectangles animated:(BOOL)animated

Parameters

selectionRectangles

The selection rectangles to set

animated

Whether the change of selection rectangles should be animated

Declared In

DTTextSelectionView.h