cell嵌套UICollectionView是项目中常用的一种功能这篇文章其实只有一个知识点 就是如何根据数据源数量的多少来动态布局UICollectionView
- 对Masonry布局不太熟悉的哥们 可以搜下 标哥的技术博客
- 为了不要每次计算cell的高度,最好的模型中添加一个高度的属性
@interface HomeModel : NSObject
@property (nonatomic,copy)NSString *icon;
@property (nonatomic,copy)NSString *contentText;
@property (nonatomic,assign)CGFloat cellHeight;
@property (nonatomic,copy)NSArray *dataArray;
@end
回到正题
在下面这个数据源中调用cell中自定义的刷新方法 ,详细代码查看demo
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
[cell reloadData:model];
}