I need to disable url selection from my text view. I have set the data detector property to an empty array and set func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {}
method to return false. But it's still showing 'open link' option in clipboard when selecting the text. How do I disable this in my text view?
Asked
Active
Viewed 25 times
0

user1749073
- 7
- 4
-
did you check this textView.selectedTextRange = nil ?? – Chandaboy Aug 28 '23 at 05:48
-
Yes I tried that, but that is prohibiting me from editing the text view. I need to edit it, but don't have to open any urls from it – user1749073 Aug 28 '23 at 05:56
-
check this link https://stackoverflow.com/questions/54899719/how-do-i-stop-my-ios-app-from-opening-a-url-when-user-taps-on-any-link-in-the-ap – Chandaboy Aug 28 '23 at 06:06
-
All of them are disabling the tap altogether – user1749073 Aug 28 '23 at 06:49