a smooth transition between viewControllers?

Discussion in 'iOS Programming' started by jjgraz, May 11, 2009.

  1. jjgraz macrumors regular

    jjgraz

    Joined:
    Feb 13, 2009
    #1
    I currently have an application which opens to a viewController and runs for 5 seconds before removing the viewController and entering myApp. It works Great.....However....the transition between the two is rough. Is there a way to make the transition between the two ViewControllers smooth....a fade, or anything? Below is the code in appDelegate in case your not understanding. I appreciate it very much.

    Code:
    
    - (void)applicationDidFinishLaunching:(UIApplication *)application {   
    	NSTimer *currentTimer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(theActionMethod) userInfo:nil repeats:NO];
    	[window addSubview:viewController.view];
            [window makeKeyAndVisible];
    }
    
    
    - (void)theActionMethod {
    	[viewController.view removeFromSuperview];
    	[window addSubview:rootController.view];
    }
    
    Thank you.
     
  2. Niiro13 macrumors 68000

    Joined:
    Feb 12, 2008
    Location:
    Illinois
    #2
    Take a look at CATransition, which is demonstrated in the ViewTransitions Apple sample code.

    It has a variety of view transitions, including fade.

    (you're adding the code after the "window addSubview" line)
     

Share This Page