SquareFlowLayout
🌄 UICollectionViewLayout subclass inspired by Instagram Discover page style layout.
Install / Use
/learn @ChernyshenkoTaras/SquareFlowLayoutREADME
SquareFlowLayout
<p><img src="https://github.com/ChernyshenkoTaras/SquareFlowLayout/blob/master/SquareFlowLayout/Screenshots/SquareFlowLayout-4.png" alt="Smiley face" align="right"> </p>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
- Download and drop
Classesfolder into your project. - Congratulations!
Usage
- Set
SquareFlowLayoutto your UICollectionView and set itflowDelegate
let flowLayout = SquareFlowLayout()
flowLayout.flowDelegate = self
self.collectionView.collectionViewLayout = flowLayout
- Make your class conform to
SquareFlowLayoutDelegate - Use delegate method to decide which cell should be pinned
extension ViewController: SquareFlowLayoutDelegate {
func shouldExpandItem(at indexPath: IndexPath) -> Bool {
return self.layoutValues[indexPath.row] == .expanded
}
}
- 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.
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.2kCommit, push, and open a PR
