firstRect(for:)
Returns the first rectangle that encloses a range of text in a document.
Declaration
func firstRect(for range: UITextRange) -> CGRectParameters
- range:
An object that represents a range of text in a document.
Return Value
The first rectangle in a range of text. You might use this rectangle to draw a correction rectangle. The “first” in the name refers the rectangle enclosing the first line when the range encompasses multiple lines of text.