mirror of
https://github.com/zhigang1992/CCHLinkTextView.git
synced 2026-04-24 04:04:59 +08:00
fix issue #7
This commit is contained in:
@@ -158,8 +158,16 @@ NSString *const CCHLinkAttributeName = @"CCHLinkAttributeName";
|
||||
|
||||
NSAttributedString *attributedString = self.attributedText;
|
||||
[attributedString enumerateAttribute:CCHLinkAttributeName inRange:NSMakeRange(0, attributedString.length) options:0 usingBlock:^(id value, NSRange range, BOOL *stop) {
|
||||
if (found) {
|
||||
*stop = YES;
|
||||
return;
|
||||
}
|
||||
if (value) {
|
||||
[self enumerateViewRectsForRanges:@[[NSValue valueWithRange:range]] usingBlock:^(CGRect rect, NSRange range, BOOL *stop) {
|
||||
if (found) {
|
||||
*stop = YES;
|
||||
return;
|
||||
}
|
||||
if (CGRectContainsPoint(rect, location)) {
|
||||
found = YES;
|
||||
*stop = YES;
|
||||
|
||||
Reference in New Issue
Block a user