I'm implementing a "search as you type" search with a core data DB. It's working great with NSFetchedRequestController
. But now, I have gotten a feature request to arrange the results by distance from the user(it's a shop list).
Say the user write "e" into the search, there are about 7000 results, the iOS device takes between 2-3 second to order them by distance, and in the meantime the UI is stuck.
I thought about sending the sort request to a different thread, but then what will I show the user? also, what happens if I send a request and then he type another letter? if he types and deletes a couple of times I will have many requests on many threads taking up computing power.
Any ideas with solving this problem?