Member-only story

Create a Horizontally Scrolling UICollectionView with Dynamic Cell Sizes

Left-to-right

Steven Curtis
3 min readJun 24, 2020
Photo by Mylon Ollila on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging<br/>

This article has been developed using Xcode 11.4.1, and Swift 5.2.2

Prerequisites:

  • You will be expected to be aware how to make a Single View Application in Swift
  • The solution to this article is Auto Layout based, so some knowledge of that would be useful

Terminology:

UICollectionViewCell: The on-screen cell for the UICollectionView type

UICollectionView: An object that manages an ordered collection of data items and presents them using customizable layouts

The project

There are a set of `UICollectionViewCell` objects that can be used horizontally. But here in this article we want to do more than this — we want the cells to be sized to their content (which will be the text label).

The cell

The UICollectionViewCell here is a particularly simple cell instance.

--

--

No responses yet