📏 A set of advanced compositional layouts for UICollectionView
with examples. All the layouts support both portrait
and landscape
orientations as well as support for all iOS
and iPadOS
related size classes.
Please wait while the .gif
files are loading (there are 12 files, that weight around 200Mb)...
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
There are no dependencies as well as any package managers involved. The project has more like a demo app setup e.g simply grab what you need for your needs. Each layout is wrapped into a separate UIViewController
type for convenience (I could've create a separate layout factory and have just a single view controller, however, for the sake of simplicity I decided to make it possible to extract layouts with all the dependent code).
Simply grab a UIViewController
type with a custom layout and adjust it for your needs. The layouts are in here.
viewWillTransition(to size: , with coordinator:)
method (of UIViewController
class) and setCollectionViewLayout(, animated: completion:)
method of UICollectionView
class to properly animate changes of layout when changing orientation.UICollectionViewTransitionLayout
, which is (a quote from Apple's Docs
):A special type of layout object that lets you implement behaviors when changing from one layout to another in your collection view.
The assets used in this project were taken from the Web
. Do not use them for commercial purposes and proprietary projects. They are used just for demonstration only.
The project is available under MIT Licence