您的位置:首页 > 其它

动画切换rootViewController

2015-09-30 18:39 351 查看
- (void)restoreRootViewController:(UIViewController *)rootViewController
{

typedef void (^Animation)(void);
UIWindow* window = self.window;

Animation animation = ^{
BOOL oldState = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
window.rootViewController = rootViewController;
[UIView setAnimationsEnabled:oldState];
};

[UIView transitionWithView:window
duration:0.5f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:animation
completion:nil];

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: