From fad9d607f6c7bc9f479491c4557a1400ac69858d Mon Sep 17 00:00:00 2001 From: kun <1315385515@qq.com> Date: Thu, 17 Sep 2020 14:09:37 +0800 Subject: [PATCH] Fix: Incompatible block pointer types sending Xcode 12: Incompatible block pointer types sending 'void (^__strong)(__strong id)' to parameter of type 'void (^)(__strong id)' --- .../TYAttributedLabel/TYTextContainer.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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