Merge results from NSURLSession back on to the main thread UI

I have apps that send requests for route between 2 locations and search, filter then display facilities near the route. The apps first send a request for the route on a background thread, then based on route, search for facilities near certain locations on or near the route. There maybe multiple searches on the same route, each on a different location. Suitable results then are displayed on the map. Apps also do live updates.

However, since I have switched to using NSURLSession to search for the route on a background thread, not all suitable results/pin are displayed. Certain pins only show up upon the next didUpdateToLocation call.

So my question is, what is the best practice to sync the results on the UI? Why do only some of the results show up on the UI, and others don't.

Answered by DTS Engineer in 798678022
Merge results from NSURLSession back on to the main thread UI
 
 
Q