🌄 UICollectionViewLayout subclass inspired by Instagram Discover page style layout.
Makes your
UICollectionViewto looks like Instagram explore has never been so easy before.
SquareFlowLayoutprovide dynamic layout generation by defining which IndexPath should be expanded.
pod 'SquareFlowLayout'
Classesfolder into your project.
SquareFlowLayoutto your UICollectionView and set it
flowDelegate
let flowLayout = SquareFlowLayout() flowLayout.flowDelegate = self self.collectionView.collectionViewLayout = flowLayout
SquareFlowLayoutDelegate
extension ViewController: SquareFlowLayoutDelegate { func shouldExpandItem(at indexPath: IndexPath) -> Bool { return self.layoutValues[indexPath.row] == .expanded } }
If you like this tool, show your support by tell me how do u use it.
This code is distributed under the terms and conditions of the MIT license.