Skip to content

Commit 137b5ed

Browse files
committed
修复customLink点击交互bug
1 parent 0b21f43 commit 137b5ed

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.DS_Store

0 Bytes
Binary file not shown.

MYCoreText_Example/MYCoreTextLabel/MYCoreTextLabel.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
320320
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
321321
{
322322
[self dismissAnimation];
323+
if ([self.delegate respondsToSelector:@selector(coreTextLabelLinkTouch:link:type:)]) {
324+
[self.delegate coreTextLabelLinkTouch:self link:self.currentTouchLink.linkText type:self.currentTouchLink.linkType];
325+
}
323326
}
324327

325328
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
@@ -358,9 +361,9 @@ - (MYLinkModel *)selectedLink:(CGPoint)touchPoint
358361
linkModel = link;
359362
self.currentTouchLink = link; //记录当前点击
360363
//回调内容
361-
if ([self.delegate respondsToSelector:@selector(coreTextLabelLinkTouch:link:type:)]) {
362-
[self.delegate coreTextLabelLinkTouch:self link:linkModel.linkText type:linkModel.linkType];
363-
}
364+
// if ([self.delegate respondsToSelector:@selector(coreTextLabelLinkTouch:link:type:)]) {
365+
// [self.delegate coreTextLabelLinkTouch:self link:linkModel.linkText type:linkModel.linkType];
366+
// }
364367
break;
365368
}
366369
}

0 commit comments

Comments
 (0)