diff --git a/TYAttributedLabelDemo/TYAttributedLabel/TYTextContainer.m b/TYAttributedLabelDemo/TYAttributedLabel/TYTextContainer.m index 24912a4..b413792 100755 --- a/TYAttributedLabelDemo/TYAttributedLabel/TYTextContainer.m +++ b/TYAttributedLabelDemo/TYAttributedLabel/TYTextContainer.m @@ -552,7 +552,15 @@ - (BOOL)enumerateRunRectContainPoint:(CGPoint)point viewHeight:(CGFloat)viewHeig - (BOOL)enumerateLinkRectContainPoint:(CGPoint)point viewHeight:(CGFloat)viewHeight successBlock:(void (^)(id textStorage))successBlock { - return [self enumerateRunRect:_linkRectDictionary ContainPoint:point viewHeight:viewHeight successBlock:successBlock]; + void (^callBack)(id) = ^(id textStorage) { + BOOL isLinkStorage = [textStorage conformsToProtocol:@protocol(TYLinkStorageProtocol)]; + if(isLinkStorage) { + id obj = (id) textStorage; + successBlock(obj); + } + }; + return [self enumerateRunRect:_linkRectDictionary ContainPoint:point viewHeight:viewHeight successBlock:callBack]; + //return [self enumerateRunRect:_linkRectDictionary ContainPoint:point viewHeight:viewHeight successBlock:successBlock]; } - (BOOL)enumerateRunRect:(NSDictionary *)runRectDic ContainPoint:(CGPoint)point viewHeight:(CGFloat)viewHeight successBlock:(void (^)(id textStorage))successBlock