Jefferson Jefferson - 4 months ago 22
iOS Question

RootViewController Switch Transition Animation

Is there any way to have a Transition/animation effect while replacing an existing viewcontroller as rootviewcontroller with a new one in the appDelegate?

Answer

Sure. Just wrap the switching of the rootViewController in a transition block:

[UIView transitionWithView:self.window
                  duration:0.5
                   options:UIViewAnimationOptionTransitionFlipFromLeft
                animations:^{ self.window.rootViewController = newViewController; }
                completion:nil];
Comments