//
//  UITableViewCell+ios14Bug.m
//  Open
//
//  Created by 雷俊博 on 2020/12/14.
//  Copyright © 2020 黄江涛 . All rights reserved.
//

#import "UITableViewCell+ios14Bug.h"
#import <objc/message.h>

@implementation UITableViewCell (ios14Bug)


//+ (void)load{
//    [super load];
//    //u一次创建，一劳永逸
//    static dispatch_once_t onceToken;
//    dispatch_once(&onceToken, ^{
//        SEL originalSelector = @selector(addSubview:);
//        SEL swizzledSelector = @selector(rt_addSubview:);
//        
//        Method newMethod = class_getInstanceMethod([self class], swizzledSelector);
//        Method oldMethod = class_getInstanceMethod([self class], originalSelector);
//        
//        BOOL isSuccess = class_addMethod([self class], originalSelector, method_getImplementation(newMethod), method_getTypeEncoding(newMethod));
//        
//        if (isSuccess) {
//            
//            class_replaceMethod([self class], swizzledSelector, method_getImplementation(oldMethod), method_getTypeEncoding(oldMethod));
//            
//        }else {
//            method_exchangeImplementations(oldMethod, newMethod);
//        }
//    });
//}
//
//- (void)rt_addSubview:(UIView *)view {
//    if (![NSStringFromClass([view class]) containsString:@"UITableViewCellContentView"]) {
//        [self.contentView addSubview:view];
//    }else{
//        [self rt_addSubview:view];
//    }
//}

@end
