SquareFlowLayout
Makes your UICollectionView
to looks like Instagram explore has never been so easy before.
SquareFlowLayout
provide dynamic layout generation by defining which IndexPath should be expanded.
安装
CocoaPods
即将推出!
手动方式
- 下载并拖动
Classes
文件夹到您的项目中。 - 恭喜!
使用
- 将
SquareFlowLayout
设置到您的 UICollectionView 并设置它的flowDelegate
let flowLayout = SquareFlowLayout()
flowLayout.flowDelegate = self
self.collectionView.collectionViewLayout = flowLayout
- 使您的类符合
SquareFlowLayoutDelegate
并使用shouldExpandItem(at: ) -> Bool
来决定哪些单元格将被展开 - 设计您的单元格
- 用数据填充您的 collectionView
为该项目做出贡献
如果你喜欢这个工具,请通过告诉我你是如何使用它的来支持我。
许可证
本代码遵循 MIT 许可证 的条款和条件。