Getting Started with Search
In the previous chapter, you added a way for the user to get a photo from the camera or photo library, which can be added to a new journal entry.
In this chapter, you will implement a search bar for the Journal List screen. You’ll start by modifying the JournalListViewController
class to conform to the UISearchResultsUpdating
protocol and display a search bar on the Journal List screen. Next, you’ll modify the data source methods to display the correct journal entries when the user types in a search term. After that, you’ll modify the prepare(for:sender:)
method to ensure that the correct journal entry details are displayed on the Journal Entry Detail screen. Finally, you’ll modify the method used to delete a journal entry.
By the end of this chapter, you’ll have learned how to implement a search bar for your own apps. To name one example, if you were creating a contacts app, you could use a search bar to search...