Getting Started with Collection Views
In the previous chapter, you implemented a search bar for the Journal List screen, and your app is now complete. However, your app is designed to suit the iPhone’s screen, and if you were to run it on an iPad or Mac, you’d see that it does not make the best use of the larger screen size.
In this chapter, you will replace the table view on the Journal List screen with a collection view, which will make better use of the extra screen space available when you run your app on an iPad or Mac. You’ll also dynamically modify the number of columns and the collection view cell sizes when your device is rotated using size classes.
First, in the Main
storyboard file, you’ll replace the table view on the Journal List screen with a collection view and configure the collection view cell to display the same information the table view cell used to display. Next, you’ll refactor the JournalListViewController
and JournalListTableViewCell...