This library requires iOS 7.0+
, Swift 4
and Xcode 9.0+
.
- Init WaterfallFlowLayout && set delegate.
let waterfallFlowLayout = WaterfallFlowLayout()
waterfallFlowLayout.delegate = self
let collectionView = UICollectionView(frame: view.frame, collectionViewLayout: waterfallFlowLayout)
- Implements WaterfallFlowLayoutDelegate.
func waterfallFlowLayout(_ layout: WaterfallFlowLayout, heightForItemAtIndexPath indexPath: IndexPath, itemWidth: CGFloat) -> CGFloat
func columnCountInWaterfallFlowLayout(_ layout: WaterfallFlowLayout) -> Int
func columnSpacingInWaterfallFlowLayout(_ layout: WaterfallFlowLayout) -> CGFloat
func rowSpacingInWaterfallFlowLayout(_ layout: WaterfallFlowLayout) -> CGFloat
func edgeInsetsInWaterfallFlowLayout(_ layout: WaterfallFlowLayout) -> UIEdgeInsets
Add the source file 'WaterfallFlowLayout' to your Xcode project.
WaterfallFlowLayout is provided under the MIT license. See LICENSE file for details.