1
votes

I have a Tab Bar Controller-based app which has four views. I have a Splash screen I load in my AppDelegate which after a period of time shows the Tab Bar as follows:

// Show tab bar [window addSubview:tabBarController.view];

What I would like to do is keep the Splash screen visible and in my first view that is loaded show the tabBarController only after my webViewDidFinishLoad delegate in FirstViewController.m is executed the first time.

Is there any way to do this? I am just learning how to do this and so far I seem to be having no luck with any of the code I have tried to achieve this. I still don't know how to hide and show the UITabBarController however.

EDIT: I found this code which is useful as a barrier for the code I need to show the parent UITabBarController:

  • (void)webViewDidFinishLoad:(UIWebView *)webView { // finished loading, hide the activity indicator in the status bar [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;

    // Still loading? if (web.loading) return; }

1
just as a side note - make sure if your webview is loading a page on the internet that you check for a network connection. Otherwise your application will hang at the splash screen when there is not connection and it wont get accepted in the App Store.mackross

1 Answers

1
votes

Make a object of your splash screen by using Nib and add this on window

[window addSubView:obj]; [self performSelector:@selector(loadFirstViewOnDelay) withObject:nil afterDelay:0.5];

in DidFinishLaunching

then

-(void)loadFirstViewOnDelay {

[window addSubview:tabBarController.view]; }