Files
yingmeng-ios-switf/yinmeng-ios/Base/Security/YYTextAsyncLayer+YinTextAsyncLayer.m
2024-03-23 20:47:19 +08:00

28 lines
707 B
Objective-C

//
// YYTextAsyncLayer+XPTextAsyncLayer.m
// xplan-ios
//
// Created by yinmeng on 2023/10/28.
//
#import "YYTextAsyncLayer+YinTextAsyncLayer.h"
#import <objc/runtime.h>
@implementation YYTextAsyncLayer (YinTextAsyncLayer)
+(void)load {
Method yin_displayMethod = class_getInstanceMethod(self, @selector(display));
Method yin_swizzingMethod = class_getInstanceMethod(self, @selector(yin_swizzing_display));
method_exchangeImplementations(yin_displayMethod, yin_swizzingMethod);
}
-(void)yin_swizzing_display{
if (self.bounds.size.width <= 0 || self.bounds.size.height <= 0) {
self.contents = nil;
return;
} else {
[self yin_swizzing_display];
}
}
@end