textView.editable = NO;
textView.selectable = YES;
textView.delegate = self;
textView.dataDetectorTypes = UIDataDetectorTypeLink;
textView.linkTextAttributes = @{};//清空默认
-
(BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange {
BOOL canOpen = [ONEValidJudge isValidString:URL.scheme] && [URL.scheme isEqualToString:[self p_insureURLStr]];
if ( canOpen ) {[[UIApplication sharedApplication] openURL:URL]; return NO;
}
return YES;
}
网友评论