项目作者: ChernyshenkoTaras

项目描述 :
🌄 UICollectionViewLayout subclass inspired by Instagram Discover page style layout.
高级语言: Swift
项目地址: git://github.com/ChernyshenkoTaras/SquareFlowLayout.git
创建时间: 2018-11-11T09:18:46Z
项目社区:https://github.com/ChernyshenkoTaras/SquareFlowLayout

开源协议:MIT License

下载


SquareFlowLayout

Swift 4.2.x
License
PRs Welcome

Smiley face

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.

Installation

CocoaPods

pod 'SquareFlowLayout'

Manually

  1. Download and drop Classes folder into your project.
  2. Congratulations!

Usage

  1. Set SquareFlowLayout to your UICollectionView and set it flowDelegate
  1. let flowLayout = SquareFlowLayout()
  2. flowLayout.flowDelegate = self
  3. self.collectionView.collectionViewLayout = flowLayout
  1. Make your class conform to SquareFlowLayoutDelegate
  2. Use delegate method to decide which cell should be pinned
    1. extension ViewController: SquareFlowLayoutDelegate {
    2. func shouldExpandItem(at indexPath: IndexPath) -> Bool {
    3. return self.layoutValues[indexPath.row] == .expanded
    4. }
    5. }
  3. Look into example project for more info



Contributing to this project

If you like this tool, show your support by tell me how do u use it.

License

This code is distributed under the terms and conditions of the MIT license.