JHCollectionViewComponent 1.0.1

JHCollectionViewComponent 1.0.1

jinhua 维护。



CollectionViewComponent

借鉴 React-Native 和 Weex 中组件的思想,将 UICollectionView 布局的页面进行组件化,解决复杂页面的扩展性和可维护性问题,同时增加了组件的复用性。

用户只需要关注数据和 Cell 样式,无需进行各种 registerNib、registerClass,无需实现各种 delegat e 和 dataSource,用户也不需要再手动缓存高度。

底层使用 IGListKit,屏蔽了 IGListKit 的复杂接口和内部调用,同时将数据驱动扩展到 Cell 和 Header、Footer 层级。

使用

JHIGListCollectionViewComponent* viewComponent = [[JHIGListCollectionViewComponent alloc]initWithCollectionView:self.collectionView viewController:self];
JHIGListSectionComponent* section = [[JHIGListSectionComponent alloc]init];         //section
JHIGListCellComponent* cell = [[JHIGListCellComponent alloc]init];                  //cell
JHIGListSupplementaryViewComponent* header = [[JHIGListSupplementaryViewComponent alloc]init];    //header
JHIGListSupplementaryViewComponent* footer = [[JHIGListSupplementaryViewComponent alloc]init];    //footer

section.components = @[cell];
section.headerComponent = header;
section.footerComponent = footer;

viewComponent.sections = @[section];