Ambiguous use of 'textView(_:shouldInteractWith:in:interaction:)'
解决方案
@available(iOS 10.0, *)
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
if tagert == nil {
return true
}
if tagert!.responds(to: (#selector(textView(_:shouldInteractWith:in:interaction:) as (UITextView, URL, NSRange, UITextItemInteraction) -> Bool))){
return tagert!.textView(textView, shouldInteractWith: URL, in: characterRange, interaction: interaction)
}
return true
}
@available(iOS 10.0, *)
func textView(_ textView: UITextView, shouldInteractWith textAttachment: NSTextAttachment, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
if tagert == nil {
return true
}
if tagert!.responds(to: #selector(textView(_:shouldInteractWith:in:interaction:)as (UITextView, NSTextAttachment, NSRange, UITextItemInteraction) -> Bool)){
return tagert!.textView(textView, shouldInteractWith: textAttachment, in: characterRange, interaction: interaction)
}
return true
}