characterRange(byExtending:in:)
Returns a text range from a specified text position to its farthest extent in a certain direction of layout.
Declaration
func characterRange(byExtending position: UITextPosition, in direction: UITextLayoutDirection) -> UITextRange?Parameters
- position:
A text-position object that identifies a location in a document.
- direction:
A constant that indicates a direction of layout (right, left, up, down).
Return Value
A text-range object that represents the distance from position to the farthest extent in direction.