Skip to content

Commit e020adc

Browse files
committed
增加返回range代理方法
1 parent 9e2e47a commit e020adc

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

.DS_Store

0 Bytes
Binary file not shown.

MYCoreText_Example/MYCoreTextLabel/MYCoreTextLabel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- (void)coreTextLabelLinkTouch:(MYCoreTextLabel *)coreTextLabel link:(NSString *)linkString type:(MYLinkType)linkType;
2626
//除开链接以外点击回调
2727
- (void)coreTextLabelBlankTouch:(MYCoreTextLabel *)coreTextLabel ;
28+
- (void)coreTextLabelLinkTouch:(MYCoreTextLabel *)coreTextLabel link:(NSString *)linkString type:(MYLinkType)linkType linkRange:(NSRange)range;
2829

2930
@end
3031

MYCoreText_Example/MYCoreTextLabel/MYCoreTextLabel.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
325325
if ([self.delegate respondsToSelector:@selector(coreTextLabelLinkTouch:link:type:)]) {
326326
[self.delegate coreTextLabelLinkTouch:self link:self.currentTouchLink.linkText type:self.currentTouchLink.linkType];
327327
}
328+
if ([self.delegate respondsToSelector:@selector(coreTextLabelLinkTouch:link:type:linkRange:)]) {
329+
[self.delegate coreTextLabelLinkTouch:self link:self.currentTouchLink.linkText type:self.currentTouchLink.linkType linkRange:self.currentTouchLink.range];
330+
}
331+
328332
self.currentTouchLink = nil;
329333
});
330334
}

0 commit comments

Comments
 (0)