22

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 in 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 in the Journal ...

Get iOS 17 Programming for Beginners - Eighth 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.