Contents

textView(_:primaryActionFor:defaultAction:)

Asks the delegate for the action to be performed when interacting with a text item. If a nil action is provided, the text view will request a menu to be presented on primary action if possible.

Declaration

optional func textView(_ textView: UITextView, primaryActionFor textItem: UITextItem, defaultAction: UIAction) -> UIAction?

Parameters

  • textView:

    The text view requesting the primary action.

  • textItem:

    The text item for performing said action.

  • defaultAction:

    The default action for the text item. Return this to perform the default action.

Return Value

Return a UIAction to be performed when the text item is interacted with. Return @c nil to prevent the action from being performed.

See Also

Interacting with text data