修复iOS17闪退bug

This commit is contained in:
liyuhua
2023-10-28 04:46:10 +08:00
parent 7475a578e8
commit 311d2f6041
43 changed files with 93 additions and 41 deletions

View File

@@ -0,0 +1,26 @@
//
// YYTextAsyncLayer+PITextAsyncLayer.m
// YuMi
//
// Created by duoban on 2023/10/28.
//
#import "YYTextAsyncLayer+PITextAsyncLayer.h"
@implementation YYTextAsyncLayer (PITextAsyncLayer)
///iOS17bug退
+(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];
}
}
@end