iOS 动画切换window的根控制器

// options是动画选项
[UIView transitionWithView:[UIApplication sharedApplication].keyWindow duration:0.5f options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
BOOL oldState = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
[UIApplication sharedApplication].keyWindow.rootViewController = [RootViewController new];
[UIView setAnimationsEnabled:oldState];
} completion:^(BOOL finished) {
}];

你可能感兴趣的:(iOS 动画切换window的根控制器)