Files
featherVoice/QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.m
2025-11-28 22:43:06 +08:00

74 lines
2.3 KiB
Objective-C

//
// QXIntimateCpCell.m
// QXLive
//
// Created by 启星 on 2025/11/20.
//
#import "QXIntimateCpCell.h"
@interface QXIntimateCpCell()<QXUserCpCardViewDelegate>
@property (nonatomic,strong)QXUserCpCardView *cardView;
@end
@implementation QXIntimateCpCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXIntimateCpCell";
QXIntimateCpCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[QXIntimateCpCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
cell.backgroundColor = [UIColor clearColor];
}
return cell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.backgroundColor = [UIColor clearColor];
self.contentView.backgroundColor = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self initSubviews];
}
return self;
}
-(void)setModel:(QXUserCpInfoModel *)model{
_model = model;
self.cardView.model = model;
}
-(void)setUserId:(NSString *)userId{
_userId = userId;
self.cardView.userId = self.userId;
}
-(void)initSubviews{
self.cardView = [[QXUserCpCardView alloc] init];
self.cardView.delegate = self;
[self.contentView addSubview:self.cardView];
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(24);
make.right.mas_equalTo(-24);
make.top.bottom.equalTo(self.contentView);
}];
}
-(void)didClickHeaderCardViewWithUserId:(NSString *)userId{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderCardViewWithUserId:)]) {
[self.delegate didClickHeaderCardViewWithUserId:userId];
}
}
-(void)didClickHeaderViewUserId:(NSString *)userId{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderViewUserId:)]) {
[self.delegate didClickHeaderViewUserId:userId];
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end