Files
real-e-party-iOS/YuMi/CustomUI/ShareView/View/XPShareItemCell.m
edwinQQQ a35a711be6 chore: Initial clean commit
- Removed YuMi/Library/ (138 MB, not tracked)
- Removed YuMi/Resources/ (23 MB, not tracked)
- Removed old version assets (566 files, not tracked)
- Excluded Pods/, xcuserdata/ and other build artifacts
- Clean repository optimized for company server deployment
2025-10-09 16:19:14 +08:00

79 lines
2.1 KiB
Objective-C

//
// YMShareItemCell.m
// YMRoomMoudle
//
// Created by YUMI on 2022/9/2.
// Copyright © 2023 YUMI. All rights reserved.
//
#import "XPShareItemCell.h"
#import "DJDKMIMOMColor.h"
#import <Masonry/Masonry.h>
@interface XPShareItemCell()
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation XPShareItemCell
#pragma mark - Life Style
- (instancetype)initWithFrame:(CGRect)frame{
if (self=[super initWithFrame:frame]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews{
[self.contentView addSubview:self.iconImageView];
[self.contentView addSubview:self.titleLabel];
}
- (void)initSubViewConstraints{
CGFloat wh = 30;
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.equalTo(@(wh));
make.top.equalTo(self.contentView);
make.centerX.equalTo(self.contentView);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.leading.equalTo(self.contentView).inset(5);
make.top.equalTo(self.iconImageView.mas_bottom).offset(10);
}];
}
#pragma mark - Getters And Setters
- (void)setShareItem:(XPShareItem *)shareItem{
_shareItem = shareItem;
self.userInteractionEnabled = shareItem.disable;
if (!shareItem.disable) {
self.iconImageView.image = [UIImage imageNamed:shareItem.disableImageName];
}else{
self.iconImageView.image = [UIImage imageNamed:shareItem.imageName];
}
self.titleLabel.text = shareItem.title;
}
- (UIImageView *)iconImageView{
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
}
return _iconImageView;
}
- (UILabel *)titleLabel{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textColor = [DJDKMIMOMColor alertMessageColor];
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:12];
_titleLabel.numberOfLines = 2;
_titleLabel.textAlignment = NSTextAlignmentCenter;
}
return _titleLabel;
}
@end