热更新demo

ImageSpecialCell.m 1.7KB

    // // ImageSpecialCell.m // ThePaperBase // // Created by zhousan on 15/7/24. // Copyright (c) 2015年 scar1900. All rights reserved. // #import "ImageSpecialCell.h" #import "TPImageBaseView.h" @interface ImageSpecialCell () @property (nonatomic, strong) TPImageBaseView *item; @end @implementation ImageSpecialCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { [self.contentView addSubview:self.item]; self.backgroundColor = [UIColor colorWithHexString:BackGroundColor]; [self layoutSubViews]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(needrefreshNightMode:) name:REFRESHAFTERNIGHTMODE object:nil]; } return self; } - (void)needrefreshNightMode:(id)sender{ self.backgroundColor = [UIColor colorWithHexString:BackGroundColor]; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (TPImageBaseView *)item { if (!_item) { _item = [[TPImageBaseView alloc] initWithFrame:CGRectZero]; _item.type = BASEIMAGETYPEIMAGE; } return _item; } - (void)setListContent:(listContObjectVO *)listContent { if (_listContent != listContent) { _listContent = listContent; self.item.listContent = _listContent; } } - (void)layoutSubViews { [self.item remakeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self.contentView); }]; } - (void)awakeFromNib { // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end