系统原因
可以不用textView delegate 里面的实现,而是给UITextView加上tap gesture:
- (void)handleLinkTap:(UITapGestureRecognizer *)sender {
UITextPosition *position = [contentView closestPositionToPoint:[sender locationInView:contentView]];
NSDictionary<NSAttributedStringKey, id> *testStylings = [contentView textStylingAtPosition:position inDirection:UITextStorageDirectionForward];
NSString *url = testStylings[NSLinkAttributeName];
// Handle the url
}