0

in my current app i´m using a UINavigationController to display the contents of other viewControllers. Its installed within the appDelegate like this.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];    
    self.viewController = [[ViewController alloc] init];
UINavigationController* navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
    [navigationController.navigationBar setBarStyle:UIBarStyleBlackOpaque];
    [self.window addSubview:navigationController.view];
    [[self window] setRootViewController:navigationController];
    [self.window makeKeyAndVisible];
    return YES;
}

What i want now is creating a new view controller that displays an intro video right after the splash screen. When the video playback has completed, i want to push my "StartViewController" and install the UINavigationController on it. So that would mean i would setup within one of my others ViewControllers, right?

Is that possible? Any help on that? Thanks for your time.

2 Answers 2

0

you can do this like i do below

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    capturedImg = [[UIImage alloc]init];
    self.splash = [[UIImageView alloc] initWithFrame:self.window.frame];
    splash.image = [UIImage imageNamed:@"default.png"];
    [self.window addSubview:splash];
    [self performSelector:@selector(Load_FirstView) withObject:nil afterDelay:2];
    [self.window makeKeyAndVisible];
}

and the Load_FirstView method

-(void)Load_FirstView
{    
    MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil];
    self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
    [self.window makeKeyAndVisible];
}

if you want to show video just put one other method and place it between this two methods ie call it first and then from it call Load_firstView method

0
0

thanks for your fast reply. I´ve also just found an interesting blogpost about splash screens:

http://lucas.tiz.ma/blog/2011/09/26/ios-splash-screens-done-right/

For me, that way works. And it seems, it a nice flexible way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.