Contents

UITextSelectionHandleView

An interface you use to draw custom the selection handles for ranges of text.

Declaration

@MainActor protocol UITextSelectionHandleView : UICoordinateSpace

Overview

Adopt the UITextSelectionHandleView protocol in a custom view you use to draw text-selection handles in one of your text views. Use your custom view in conjunction with a UITextSelectionDisplayInteraction object to apply your custom selection UI to one of your text views. This protocol provides the preferred frame for the selection handle, and you provide details about the handle back to the system. Use CALayer objects or your view’s draw(_:) method to draw the handles.

After adopting this protocol in your custom view, create exactly two instances and assign them to the handleViews property of the interaction object you attached to your text view. Configure one instance as the leading selection handle, and configure the other instance as the trailing selection handle.

Topics

Providing the preferred frame rectangle

Specifying the handle details

See Also

Custom text selection