DTTextRange Class Reference
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.
Tasks
Creating Text Ranges
-
+ textRangeFromStart:toEnd:
-
+ emptyRangeAtPosition:offset:
-
+ emptyRangeAtPosition:
-
+ rangeWithNSRange:
Getting Information about Text Ranges
Class Methods
emptyRangeAtPosition:
Creates an empty text range with position.
+ (DTTextRange *)emptyRangeAtPosition:(UITextPosition *)position
Parameters
- position
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
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