// // CommentModel.m // TheoryNetwork // // Created by tederen on 2019/9/29. // Copyright © 2019 tederen. All rights reserved. // #import "CommentModel.h" @implementation CommentModel - (CGFloat)getCellHeight { UILabel *textLabel = [UILabel new]; textLabel.numberOfLines = 0; textLabel.font = [UIFont systemFontOfSize:17.5f]; textLabel.text = self.Content; if (!ISEmptyString(self.Content)){ [ZYCTool setLabel:textLabel withSpace:10.f withFont:textLabel.font setLineSpace:0 setTextSpace:2.f]; } CGSize textSize = [textLabel sizeThatFits:CGSizeMake(kGXScreenWidth-68-21, MAXFLOAT)]; CGFloat height = 65+textSize.height+15; if (!ISEmptyString(self.replyName)&&!ISEmptyNumber(self.replyTimes)) { height += 50; } for (CommentSubModel *model in self.CommentReplyResults) { height += model.getCellHeight + 10; } return height; } @end