I would like to make all my UITextViews
handle link clicks by opening a web view, rather than opening safari. How can I override this delegate function for all UITextViews within my app:
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange) -> Bool
The code I want to put in it is the following:
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange) -> Bool {
let webViewController = WebViewController()
webViewController.urlToLoad = URL
present(webViewController, animated: true)
return false
}