我如何实现 CHTCollectionViewWaterfallLayout?

How do i implement CHTCollectionViewWaterfallLayout?

我正在使用 Parse PFQueryTableViewController,它在列表中显示图像,我想使用 CHTCollectionViewWaterfallLayout 在网格中显示图像就像 instagram,我该如何实现?我做了 cocoapod,但演示代码有很大不同。

如果您使用的是 xib 或故事板

select collectionView -> go to attribute inspector -> layout - select custom -> CHTCollectionViewWaterfallLayout

在 .h 文件中包含此委托 CHTCollectionViewDelegateWaterfallLayout 并使用这些委托方法,然后就可以开始了。