iOS 13 Compositional Layouts in CollectionView

Exploring the powerful new API for composing complex layouts

Photo by Atanas Teodosiev on Unsplash

The advancements Apple brought in the CollectionView layout this year proves the fact that, despite the storm SwiftUI created, UIkit isn’t over yet. At least not anytime soon, as SwiftUI does not even support CollectionView currently.

UICollectionFlowLayout works pretty well in simple layouts but as the designs are getting more heterogeneous, the need for building custom layouts comes in, which has its own share of problems.

Boilerplate code and challenges of self-sizing cells are just a few issues that make building advanced designs cumbersome.

Gladly, during WWDC 2019, Apple introduced compositional layouts with the goal to simplify the development process of complex layouts in our applications.