UIView transition 的简单使用
+ (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^ __nullable)(void))animations completion:(void (^ __nullable)(BOOL finished))completion NS_AVAILABLE_IOS(4_0);
登录页面和应用首页切换 使用到的代码 摘抄
// 切换到页面viewController
-(void)transitionToViewController:(UIViewController *) viewController options:(UIViewAnimationOptions) options{
UIWindow * window = UIApplication.sharedApplication.keyWindow;
[UIView transitionWithView:window duration:1.0 options:UIViewAnimationOptionTransitionFlipFromRight animations:^{
BOOL oldState = UIView.areAnimationsEnabled;
[UIView setAnimationsEnabled:NO];
window.rootViewController = viewController;
[UIView setAnimationsEnabled:oldState];
} completion:nil];
}