1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// CommentListTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/12/12.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CommentListTableViewCell.h"
@implementation CommentListTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
self.bestView = [[BestReplyView alloc] init];
[self.contentView addSubview:self.bestView];
[self.bestView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.optionButton.mas_left).offset(-5);
make.size.mas_equalTo(CGSizeMake(0, 30));
make.centerY.equalTo(self.optionButton);
}];
}
#pragma mark - 选项按钮
- (IBAction)extensionButtonClickAction:(UIButton *)sender {
self.bestView.hidden = NO;
if (self.bestView.width != 0) {
[UIView animateWithDuration:0.2 animations:^{
self.bestView.width = 0;
self.bestView.x = self.optionButton.x;
}];
}else {
[UIView animateWithDuration:0.2 animations:^{
self.bestView.width = 90;
self.bestView.x -= 100;
}];
}
}
#pragma mark - 赋值
- (void)setReplyEntity:(CustomTOForumReplyEntity *)replyEntity
{
_replyEntity = replyEntity;
self.bestView.replyId = _replyEntity.fid;
[self.issuerImageView sd_setImageWithURL:[NSURL URLWithString:_replyEntity.replyerPicture] placeholderImage:ReplaceImage];
self.issuerNameLabel.text = [NSString stringWithFormat:@"%@: %@",_replyEntity.replyerPosition,_replyEntity.replyerRealName];
self.issuerDateLabel.text = _replyEntity.replyTime;
self.commentContentLabel.text = _replyEntity.replyContent;
self.bestView.isBest = _replyEntity.best;
self.bestView.indexPath = self.indexPath;
self.baseImageView.hidden = !_replyEntity.best;
}
@end