views:

137

answers:

5

ok. I know how to display the splash screen on iPhone. Seems quite simple enough (i.e. setting the Default.png and calling "sleep" command).

But, is the application actually doing anything during this time? My app needs to go and fetch some data from Web before showing the app's first screen, but when I do the splash screen, it doesn't seem like it's doing this while showing the splash image.

Can I actaully make the app do something while showing the splash screen?

+1  A: 

The best way would be to structure you application differently slightly differently.

Make your application display the Default.png when it starts it (ie. put a UIImageView onto screen), then start fetching your data.

Then either when you have fetched the data (or if you really must, once an NSTimer has expired, but it's a better user experience if you avoid a fixed time interval) change the view to be your real one.

JosephH
+2  A: 

Where you have got the idea that you need to call "sleep" while showing Default.png and there is nothing going on while this image is shown? Default.png is shown when OS is loading your app. You can not do anything during this time. In fact you have not got any control yet. It is handled by the OS. The idea behind this is to give user a feeling that app has loaded quickly, but actually your app is not completely loaded while Default.png is showing instead of a black screen by the OS.

taskinoor
There's a "tutorial" somewhere that tells people to put a sleep in the App Delegate, to make the splash screen stay up for a bit and mimic real loading behavior. Horrible but true.
Dan Ray
Horrible in deed.
taskinoor
+1  A: 

You can manually add a view looking like your splashscreen after starting your app and handle the work in background. I would also add a hint to the user which indicates "loading data", because an app should start within 3 seconds.

AlexVogel
+1  A: 

If you read the Human Interface Guidlines, they're pretty clear that Default.png isn't intended to be a branding splash screen. It's meant to bring up a static "shell" of the initial page of UI so that the user experiences quick loading. So it's not at all designed or intended for what a lot of apps are using it for (including some of mine).

If you have your first screen that comes up be that image again, maybe with an activity spinner or status text on it, you can do whatever you need to do in the background of it, and then replace it with the first "real" screen of your app when you're done.

Dan Ray
A: 

Generally all of the awakeFromNib calls in view controllers are done while the app is loading (ie has the splash screen up). When I put breakpoints in my apps at awakeFromNib calls, the breakpoints are hit when the splashscreen is up and the app is loading. So everything you do in those calls will be processed while the loading screen is up.