// // CustomTOPassLevelTopicOptionEntity.m // Lighting // // Created by 曹云霄 on 2016/12/7. // Copyright © 2016年 上海勾芒科技有限公司. All rights reserved. // #import "CustomTOPassLevelTopicOptionEntity.h" @implementation CustomTOPassLevelTopicOptionEntity - (CGFloat)answerHeight { if (!_answerHeight) { _answerHeight = [self calculateStudyIntroductionHeight:self.name]+30; } return _answerHeight; } #pragma mark - 计算高度 - (CGFloat)calculateStudyIntroductionHeight:(NSString *)content { CGSize s = [content boundingRectWithSize:CGSizeMake(437, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]} context:nil].size; return s.height; } @end