My app has a textView which detects links, when I peek on a link it shows the web page preview but when it pops it opens the Safari app instead of the Safari View Controller.
I have implemented the 'shouldInteractWith url' method from the UITextViewDelegate and when the user taps the link it opens in the Safari VC, but not when doing 3D Touch...
This is what I have right now:
@available(iOS 10.0, *)
func textView(_ textView: UITextView, shouldInteractWith url: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
if interaction == .invokeDefaultAction {
safariOpenURLFromString(url.absoluteString)
return false
}
return true
}
I want to achieve something like this:
Should I just make another View Controller on the storyboard and just join them with a segue?