@@ -320,9 +320,12 @@ - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
320
320
- (void )touchesEnded : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event
321
321
{
322
322
[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
- }
323
+ dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
324
+ if ([self .delegate respondsToSelector: @selector (coreTextLabelLinkTouch:link:type: )]) {
325
+ [self .delegate coreTextLabelLinkTouch: self link: self .currentTouchLink.linkText type: self .currentTouchLink.linkType];
326
+ }
327
+ self.currentTouchLink = nil ;
328
+ });
326
329
}
327
330
328
331
- (void )touchesMoved : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event
@@ -338,12 +341,14 @@ - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
338
341
}
339
342
if (!isContained) {
340
343
[self dismissAnimation ];
344
+ self.currentTouchLink = nil ;
341
345
}
342
346
}
343
347
344
348
- (void )touchesCancelled : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event
345
349
{
346
350
[self dismissAnimation ];
351
+ self.currentTouchLink = nil ;
347
352
}
348
353
349
354
@@ -393,7 +398,6 @@ - (void)addSelectedAnimation:(MYLinkModel *)linkModel
393
398
#pragma mark - 点击动画
394
399
- (void )dismissAnimation
395
400
{
396
- self.currentTouchLink = nil ;
397
401
dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
398
402
399
403
for (UIView *coverView in self.subviews ) {
0 commit comments