attributedSubstringFromRange:
Returns an attributed string derived from the given range in the receiver’s text storage.
Declaration
- (NSAttributedString *) attributedSubstringFromRange:(NSRange) range;Parameters
- range:
The range in the text storage from which to create the returned string.
Return Value
The string created from the given range.
Discussion
This method allows input mangers to query any range in text storage.
An implementation of this method should be prepared for theRange to be out-of-bounds. For example, the InkWell text input service can ask for the contents of the text input client that extends beyond the document’s range. In this case, you should return the intersection of the document’s range and theRange. If the location of theRange is completely outside of the document’s range, return nil.