当我与第三方成功登录然后跳转到UITabBarController时,UITabBarController的viewWillAppear
总是执行两次。
这是跳转到UITabBarController的代码。 TTabBarVC继承自UITabBarController。
TTabBarVC *vc = [TTabBarVC new];
KLNavigationController *nc = [[KLNavigationController alloc] initWithRootViewController:vc];
UIViewController *oldRootVC = [UIApplication sharedApplication].keyWindow.rootViewController;
[UIView transitionFromView:oldRootVC.view toView:nc.view duration:.3f options:UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionTransitionCrossDissolve completion:^(BOOL finished) {
[UIApplication sharedApplication].keyWindow.rootViewController = nc;
}];