FDTemplateLayoutCell - cell 高度缓存

第三方库地址: https://github.com/forkingdog/UITableView-FDTemplateLayoutCell

pod 'UITableView+FDTemplateLayoutCell'

简单粗暴好用的 cell 高度缓存

关键代码,不多说了,

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 

Entity *entity = self.entities[indexPath.row]; 
return [tableView fd_heightForCellWithIdentifier:@"identifer" cacheByKey:entity.uid configuration:^(id cell) { 

// configurations  添加与 return cell 里一致的代码就好了。

}];
}

你可能感兴趣的:(FDTemplateLayoutCell - cell 高度缓存)