适配iOS17
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
</Testables>
|
</Testables>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
|
@@ -10,13 +10,13 @@
|
|||||||
@implementation YYTextAsyncLayer (PITextAsyncLayer)
|
@implementation YYTextAsyncLayer (PITextAsyncLayer)
|
||||||
///iOS17bug,如果不把方法替换会闪退
|
///iOS17bug,如果不把方法替换会闪退
|
||||||
+(void)load {
|
+(void)load {
|
||||||
Method a = class_getInstanceMethod(self, @selector(display));
|
Method displayMethod = class_getInstanceMethod(self, @selector(display));
|
||||||
Method b = class_getInstanceMethod(self, @selector(swizzing_display));
|
Method swizzingMethod = class_getInstanceMethod(self, @selector(swizzing_display));
|
||||||
method_exchangeImplementations(a, b);
|
method_exchangeImplementations(displayMethod, swizzingMethod);
|
||||||
}
|
}
|
||||||
-(void)swizzing_display{
|
-(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;
|
self.contents = nil;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user