Skip to content

Instantly share code, notes, and snippets.

@JigarM
Last active August 29, 2015 14:13
Show Gist options
  • Save JigarM/490f6163941bcac15186 to your computer and use it in GitHub Desktop.
Save JigarM/490f6163941bcac15186 to your computer and use it in GitHub Desktop.
//https://gist.github.com/gimenete/53704124583b5df3b407 : Originsl gist
- (void)changeRootViewController:(UIViewController*)viewController {
if (!self.window.rootViewController) {
self.window.rootViewController = viewController;
return;
}
UIView *snapShot = [self.window snapshotViewAfterScreenUpdates:YES];
[viewController.view addSubview:snapShot];
self.window.rootViewController = viewController;
[UIView animateWithDuration:0.3 animations:^{
snapShot.layer.opacity = 0;
snapShot.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5);
} completion:^(BOOL finished) {
[snapShot removeFromSuperview];
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment