Question

I have an app that needs to fetch some remote configuration files before it starts or after it has been idle for some time in the background. I use a loader view controller to do the job while displaying a splash screen with a loading indicator.

What would be the best way to display the loader (assuming I also want to refresh the whole app after idle time in background):

  1. Display as a modal view controller and dismiss when finished
  2. Set the loader as root view controller and set back the original root when the loader finish (this method triggers a dealloc for the original root and creates it from scratch)
Was it helpful?

Solution

Go with option 1. I've used it many times and it works brilliantly. The best thing about using a modal view controller is that you can smoothly transition when you dismiss it, and you can just present it un-animated on applicationDidFinishLaunch so that it's there instantly for the user to see.

OTHER TIPS

  1. Display as a modal view controller and dismiss when finished.

This option will be more feasible when your app will starts from background state. You can show this with no animation show it will feel like splash and you can fetch remote configuration files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top