Share this:

Related

About Jay Versluis

Jay is a medical miracle known as Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.
View all posts by Jay Versluis →

Post navigation

2 thoughts on “Building a searchable UITableView in iOS 9 – Part 1”

Hi Jay,
Very good tutorial and it helped me a lot in my project. I use core data with AccountsTitle and Category as section. When I search for AccountTitle, i pass the search text to the second SearchViewController. There I use that search to create a Predicate that retrieves results using NSFetchResultsController. Filtration works well but the issue is it lags. I wanted something as smooth as the search feature in Contacts on iOS. Any idea how to fix this. Thanks,

Thanks Nabeel, great to hear my tutorial helped you out! There are two things you can try to speed up performance: first, you can add a cache to the NSFetchedResultsController. This may help retrieve results quicker for all your records. Apple’s template does it like this:

The predicate however is where it can get tight and laggy, and the only real option to speed up queries is to make them simpler to process. For example, BEGINSWITH is less expensive than CONTAINS. Ignoring case and diacritics is faster than checking for them, and so forth. See how you can help iOS retrieve the most important info.