Files
yinmeng-ios/xplan-ios/Main/ModuleKit/FaceView/View/Cell/XCGameRoomFaceTitleCell.m
2022-03-10 18:55:18 +08:00

80 lines
2.2 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// XCGameRoomFaceTitleCell.m
// XCRoomMoudle
//
// Created by 卫明何 on 2018/8/23.
// Copyright © 2018年 卫明何. All rights reserved.
//
#import "XCGameRoomFaceTitleCell.h"
#import "XCGameRoomFaceTitleButton.h"
#import <Masonry/Masonry.h>
//3rd part
@interface XCGameRoomFaceTitleCell ()
@property (strong, nonatomic) XCGameRoomFaceTitleButton *titleButton;
@end
@implementation XCGameRoomFaceTitleCell
#pragma mark - life cycle
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initView];
[self initConstrations];
}
return self;
}
#pragma mark - public methods
#pragma mark - [系统控件的Protocol] //注意要把名字改掉这个MARK只做功能划分不是一个真正的MARK每个不一样的Protocol需要一个新的MARK”
#pragma mark - [自定义控件的Protocol] //注意要把名字改掉这个MARK只做功能划分不是一个真正的MARK每个不一样的Protocol需要一个新的MARK”
#pragma mark - [core相关的Protocol] //注意要把名字改掉这个MARK只做功能划分不是一个真正的MARK每个不一样的Protocol需要一个新的MARK”
#pragma mark - event response
#pragma mark - private method
- (void)initView {
[self.contentView addSubview:self.titleButton];
}
- (void)initConstrations {
[self.titleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(UIEdgeInsetsZero);
}];
}
- (void)setDisplayModel:(XCGameRoomFaceTitleDisplayModel *)displayModel {
_displayModel = displayModel;
NSAssert(displayModel.title.length > 0, @"XCGameRoomFaceTitleDisplayModel 's protype name title can'not be nil");
self.titleButton.title = displayModel.title;
self.titleButton.selected = displayModel.isSelected;
}
#pragma mark - getters and setters
- (XCGameRoomFaceTitleButton *)titleButton {
if (!_titleButton) {
_titleButton = [XCGameRoomFaceTitleButton buttonWithType:UIButtonTypeCustom];
_titleButton.isShowUnderline = YES;
}
return _titleButton;
}
@end