// // TFCommonCell.m // trueface // // Created by Apple on 2019/10/9. // Copyright © 2019 jie. All rights reserved. // #import "YOUPAITFBaseCell.h" @implementation YOUPAITFBaseCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } +(instancetype)youpaifcellWithTableViewCell:(UITableView *)tableView { NSString *className = NSStringFromClass([self class]); UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:className]; if(cell == nil) { cell = [[[super class] alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:className]; cell.selectionStyle = UITableViewCellSelectionStyleNone; //v.1.5.6适配暗黑模式 动态 [cell.contentView setBackgroundColor:[UIColor whiteColor]]; } return (YOUPAITFBaseCell *)cell; } -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self youpaifsetupUI]; } return self; } -(void)youpaifsetupUI { [self.contentView setBackgroundColor:[UIColor whiteColor]]; [self setSelectionStyle:UITableViewCellSelectionStyleNone]; } - (void)layoutSubviews { [super layoutSubviews]; // // [self.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull subView, NSUInteger idx, BOOL * _Nonnull stop) { // if ([subView isKindOfClass:NSClassFromString(@"_UITableViewCellSeparatorView")]) { // subView.x = 0; // subView.width = KScreenW; // subView.height = 0.5; // [subView setBackgroundColor:[UIColor blackColor]]; // } // }]; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end