Search screen

The search screen has a search field at the top. This UISearchBar is a standard component that is used to allow the user to search through the data displayed on the screen. The UI component doesn't do the actual searching. It handles the user's interactions, and UISearchBarDelegate is responsible for taking action:

This is the layout of the screen, with a search bar at the top and a collection view below it. They are using constraints to fill the whole screen.

We need a new SearchViewController.swift file. It will store the logic of the view controller. The following code shows the initial implementation of the SearchViewController ...

Get Learn Swift by Building Applications 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.