Question

Basically my app loads two RSS feeds - a blog feed and a twitter stream. These are in two different views in a tab bar controller. There is also a Home view which is the default view when the application launches.

Ok, so basically when you go from the Home tab to the blog or twitter tab then it takes a while to load. Fair enough, its trying to download everything off the internet.

My question is, while the user is on the home page is there any way of "preloading" the other views so that the viewDidAppear function is already run?

Or, maybe a way of having a "loading" screen, because at the moment it seems like the application has just crashed when you click on a tab, the tab doesn't even highlight until it has loaded the view.

Thanks a lot guys.

Was it helpful?

Solution

IMO it's not a good idea to preload the views themselves. But it might make sense to preload the data from the home screen (at least when you're connected to WiFi). To do that, decouple the loading code from the view, e.g. by moving it to a separate model class.

In general, you should implement all your network connections asynchronously to avoid freezing the UI during these operations.

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