热更新demo

TopicAskContCell.m 2.0KB

    // // TopicAskContCell.m // ThePaperBase // // Created by zhousan on 15/11/24. // Copyright © 2015年 scar1900. All rights reserved. // #import "TopicAskContCell.h" @implementation TopicAskContCell - (void)gotoHotAskWithVO:(id)sender { if ([self.delegate respondsToSelector:@selector(gotoHotAskWithCommentVO:andIndexPath:)]) { NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow:self.indexPath.row-1 inSection:self.indexPath.section]; [self.delegate gotoHotAskWithCommentVO:self.commentBO andIndexPath:indexPath1]; } } - (void)subLayoutSubViews { __weak typeof(self) weakSelf = self; [self.backView makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self); make.bottom.equalTo(self); make.left.equalTo(self).offset(10); make.right.equalTo(self).offset(-10); }]; [self.backBtn makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(weakSelf.backView); }]; self.line = [[UIView alloc] initWithFrame:CGRectZero]; self.line.backgroundColor = [UIColor colorWithHexString:LINECOLOR]; [self.backView addSubview:self.line]; } - (void)reLayoutSubViews { [super reLayoutSubViews]; if (self.isCreat) { [self.line remakeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.backView); make.right.equalTo(self.backView); make.bottom.equalTo(self.backView); make.height.mas_equalTo(1); }]; self.line.hidden = NO; }else { [self.lineView remakeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.backView.left); make.bottom.equalTo(self.backView.bottom); make.width.equalTo(self.backView.width); make.height.mas_equalTo(0.5); }]; self.line.hidden = YES; } } /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code } */ @end