Understanding collection views

In the previous chapter, you implemented the view controllers for the collection views in the Explore and Restaurant List screens without learning how they work.

To understand how collection views work, you'll implement a UIViewController subclass that controls a collection view in your CollectionViewBasics playground. You will then compare this with the implementation for the collection views in the Explore and Restaurant List screens in the next section. As there is no storyboard in the playground, you can't add UI elements as you have done in previous chapters. Instead, you will do everything programmatically.

You'll start by creating CollectionViewExampleController, an implementation of a view controller ...

Get iOS 13 Programming for Beginners - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.