requestTextRects(for:withCompletionHandler:)
Gathers context for the presentation of a text-related user interface.
Declaration
func requestTextRects(for input: String, withCompletionHandler completionHandler: @escaping @Sendable ([UITextSelectionRect]) -> Void)func requestTextRects(for input: String) async -> [UITextSelectionRect]Discussion
The system invokes your implementation of this method. The completion handler receives UITextSelectionRect instances for the substring nearest to the caret that matches the given input.