Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone - Do something while displaying splash screen

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?

like image 284
ericbae Avatar asked Jan 22 '23 12:01

ericbae


2 Answers

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.

like image 114
JosephH Avatar answered Feb 04 '23 04:02

JosephH


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.

like image 28
taskinoor Avatar answered Feb 04 '23 03:02

taskinoor