仿微信朋友圈

#import "IIITableViewController.h"

@interface IIITableViewController ()

@end

@implementation IIITableViewController

- (UIImageView *)imgView{

    if (!_imgView) {

        _imgView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, 60, 60)];

        _imgView.layer.cornerRadius = 30;

        _imgView.layer.masksToBounds = YES;

    }

    return _imgView;

}

- (UILabel *)titleLabel{

    if (!_titleLabel) {

        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(70, 5, 80, 20)];

        _titleLabel.font = [UIFont systemFontOfSize:15];

    }

    return _titleLabel;

}

-(UILabel *)subTitleLabel{

    if (!_subTitleLabel) {

        _subTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(70, 30, 300, 20)];

        _subTitleLabel.textColor = [UIColor lightGrayColor];

        _subTitleLabel.font = [UIFont systemFontOfSize:12];

    }

    return _subTitleLabel;

}

-(UILabel *)timeLabel{

    if (!_timeLabel) {

        _timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(320, 10, 80, 20)];

        _timeLabel.textColor = [UIColor lightGrayColor];

    }

    return _timeLabel;

}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {

        [self addSubview:self.imgView];

        [self addSubview:self.titleLabel];

        [self addSubview:self.subTitleLabel];

        [self addSubview:self.timeLabel];

    }

    return  self;

}

你可能感兴趣的:(仿微信朋友圈)