适配iOS17

This commit is contained in:
liyuhua
2023-10-28 20:36:20 +08:00
parent 311d2f6041
commit b3003f1547
2 changed files with 5 additions and 5 deletions

View File

@@ -31,7 +31,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View File

@@ -10,13 +10,13 @@
@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);
Method displayMethod = class_getInstanceMethod(self, @selector(display));
Method swizzingMethod = class_getInstanceMethod(self, @selector(swizzing_display));
method_exchangeImplementations(displayMethod, swizzingMethod);
}
-(void)swizzing_display{
//
if (self.bounds.size.width<=0 || self.bounds.size.height<=0) {
if (self.bounds.size.width <= 0 || self.bounds.size.height <= 0) {
self.contents = nil;
return;
} else {