I have an imaged name Default.png. This will load when the application is launching. Now i need to add an activity indicator to it. So it will spin and make the app look nice.
We know that we can’t add any UI Components when the app is loading. So i thought to add the UIActivityIndicator in the didFinishLaunchingWithOptions method in the App delegate.
These are the steps i followed.
i added a view
added the default.png
added activity indicator
then
[window addSubView:view];
But nothing hapence.
Help how to write the code for this ?
You’re on the right track, but you do need to add another
UIViewto your window (not anotherUIViewContoller, necessarily) temporarily. I do this sort of thing often. Here’s some code that would be appropriate for yourapplicationDidFinishLaunching:withOptions:method:The ivar
startupViewbelongs to the app delegate, and later in the startup sequence another method removes it gracefully by fading it from view:It’s worth mentioning that splash screens like this are not the “recommended” startup screen in Apple’s view. But they do not seem to reject apps that have them.