我在tableviewcell中使用UITextView,并确认委托方法 shouldInteractWith;当我想滚动tableview时,它会响应并中断iOS 13中的滚动。
在iOS 12中,这很正常。只有当我向上滚动并用手指触摸链接文本时,它才会响应。
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
guard let received = self.entity as? ReceivedEventsModel else {
return false
}
if URL.scheme == "issue" && interaction == .invokeDefaultAction {
delegate?.pushToViewController(with: ["issue" : received.payload.issue!.html_url!])
return false
}
else if URL.scheme == "repo" && interaction == .invokeDefaultAction {
delegate?.pushToViewController(with: ["repo" : received.repo.name!])
return false
}
else {
return true
}
}
我希望当我手指向上滚动时,触摸滚动文本即可。