28 lines
707 B
Objective-C
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
|