To resolve the issue of unnecessary data fetches, we'll perform an initial load of all necessary data upfront in our first controller file. One problem you'll notice right away is that its quite difficult to figure out when the last piece of data was fetched. Fixing this is quite easy by using the DispatchGroup class. For each request we fire off, we'll make an enter() call, and upon completion we'll perform a leave().
Once all information is retrieved, we'll be notified and thats when we can reload our UI. This is a really fun and interesting lesson so let's get started!