Filtering and searching for data within a Table View
In this recipe we will learn how to search through our Table View to filter list items.
Following on from our previous recipe, we will learn how to use the
UISearchBar control to allow us to filter and narrow down the results of our book details.
How to do it...
To begin, follow these simple steps as outlined in the following order:
- Select the
MainStoryboard.storyboardfile from the Project Navigator window.
- From Object Library, select and drag a (
UISearchBar) Search Bar and Search Display Controller control to the top of the navigation bar of our (
UITableViewController) control that we added in previous steps.
- Next, create the
outletmethod for the search bar and name it