1、代码中使用了YYText相关库,升级到iOS17之后崩溃问题
对YYAsyncLayer添加一个category,在.m文件中增加代码
+ (void)load{
Method a =class_getInstanceMethod(self,@selector(display));
Method b =class_getInstanceMethod(self,@selector(swizzing_display));
method_exchangeImplementations(a, b);
}
- (void)swizzing_display{
//增加判断
if (self.bounds.size.width<=0 || self.bounds.size.height<=0) {
self.contents=nil;
return;
}else{
[self swizzing_display];
}
}
网友评论