UITextViewDelegate APIs are deprecated

I can see that some UITextViewDelegate methods are deprecated. Any Idea for the alternative of the following delegate method? Will there be a new alternative method in the future?

optional func textView( _ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction ) -> Bool

Did you get a deprecation warning when compiling? If so, it should include a helpful message. Or you can look in the SDK header file UITextView.h (the source of truth) where there is a new annotation that generates the message:

API_DEPRECATED("Replaced by primaryActionForTextItem: and menuConfigurationForTextItem: for additional customization options.", ios(10.0, 17.0), xros(1.0, 1.0));

I didn't get any deprecation warning. I just found out in the online API documentation that it will be deprecated. I checked the API doc UITextView.h. It is there. Thanks. I got the callback in primaryActionForTextItem and menuConfigurationForTextItem.

UITextViewDelegate APIs are deprecated
 
 
Q