Tag Archives: search

Building a searchable UITableView in iOS 9 – Part 4

In this final part of our project we’ll finish off the app by implementing a little Key Value Observation magic. This will let us update our second UITableViewController when new search results are to be displayed.

Check out the first part here, as well as a link to my demo project.

Enjoy!

Watch the full course in one convenient playlist:
Catch this episode on my iOS Dev Diary Podcast:

Building a searchable UITableView in iOS 9 – Part 3

In this part of our series we’ll take a look at how we actually filter the data that is displayed in the searchable table view. We do that using an NSPredicate.

Check out the first part here, as well as a link to my demo project.

Enjoy!

Watch the full course in one convenient playlist:
Catch this episode on my iOS Dev Diary Podcast:

Building a searchable UITableView in iOS 9 – Part 2

In the previous part we’ve setup our project and the relevant graphical bits to make the app display the table view. Now it’s time to implement the UISearchController object that will be at the heart of letting users sift through our search results. We’ll do that in this part.

Check out the first part here, as well as a link to my demo project.

Enjoy!

Watch the full course in one convenient playlist:
Catch this episode on my iOS Dev Diary Podcast:

How to create a searchable UITableView

The ingredients for a search function in a UITableView are more involved than just displaying a simple search field. First we need the standard UITableView. Next we need a UISearchBar which can be added to the top of the table view. But displaying the actual search results is something called the UISearchDisplayController.

This process isn’t very well documented from what I could find, so here’s how I did it successfully. Works fine in iOS 6.

For iOS 5 compatibility please see my comment at the end.

An updated version for iOS 7 is also available. I’ve recorded a screencast about this here:

Continue reading