// // YYTextAsyncLayer+XPTextAsyncLayer.m // xplan-ios // // Created by duoban on 2023/10/28. // #import "YYTextAsyncLayer+YinTextAsyncLayer.h" #import @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