Displaying the Grid
Let’s tackle the interface first. You are going to change the UI for PhotosViewController to display a collection view instead of displaying the image view.
Open Main.storyboard and locate the Photorama scene. You want to delete both the image view and the background view. To do this, select the background view in the document outline and press Delete. Now, drag a Collection View onto the canvas.
Because it is the rear-most view, the collection view will be pinned to the top of the entire view instead of to the top of the safe area. This is useful for scroll views (and their subclasses, like UITableView and UICollectionView) so that the content will scroll underneath the navigation bar. The scroll view will ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access