Inherits from UITextRange
Conforms to NSCopying
Declared in DTTextRange.h

Overview

This class represents a range of text in an DTRichTextEditorView. It is a concrete subclass of UITextRange.

A range is considered empty if start is equal to end because the length generally does not include the ending character, similar to a caret being position on the index of the ending character.

Class Methods

emptyRangeAtPosition:

Creates an empty text range with position.

+ (DTTextRange *)emptyRangeAtPosition:(UITextPosition *)position

Parameters

position

a DTTextPosition

Return Value

The new text range

Declared In

DTTextRange.h

emptyRangeAtPosition:offset:

Creates an empty text range with position.

+ (DTTextRange *)emptyRangeAtPosition:(UITextPosition *)position offset:(NSInteger)offset

Parameters

position

a DTTextPosition

offset

An offset to add to the location

Return Value

The new text range

Declared In

DTTextRange.h

rangeWithNSRange:

Creates a text range from an NSRange.

+ (DTTextRange *)rangeWithNSRange:(NSRange)range

Parameters

range

The NSRange to convert to a DTTextRange

Return Value

The new text range

Declared In

DTTextRange.h

textRangeFromStart:toEnd:

Convenience method to create a text range from a start and end position

+ (DTTextRange *)textRangeFromStart:(UITextPosition *)start toEnd:(UITextPosition *)end

Parameters

start

The starting position

end

The ending position

Return Value

A text range with those positions as end points

Declared In

DTTextRange.h

Instance Methods

NSRangeValue

Retrieves the NSRange value of the receiver

- (NSRange)NSRangeValue

Return Value

The range value

Declared In

DTTextRange.h

length

The length of the string range represented by the receiver

- (NSUInteger)length

Declared In

DTTextRange.h