Updating ExploreViewController for iPad

Since you can now identify what kind of device your app is running on, let's modify ExploreViewController to change the way the Explore screen looks depending on the device. The app should display two columns on the iPhone and three columns on the iPad:

  1. Click ExploreViewController.swift in the Project navigator and add the following property before viewDidLoad():
fileprivate let minItemSpacing: CGFloat = 7

The minItemSpacing property will determine the spacing between cells.

  1. Modify the initialize() method inside the private extension as follows:
func initialize() {    manager.fetch()    setupCollectionView()}

You'll see an error because setupCollectionView() is not declared or defined yet. You'll do that ...

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.