UIWindow *window = [UIApplication sharedApplication].delegate.window;
HomePageViewController *vc = [[HomePageViewController alloc]init];
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
[UIView transitionWithView:window duration:0.5 options:UIViewAnimationOptionCurveEaseInOut animations:^{
BOOL oldState = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
[window setRootViewController:nav];
[UIView setAnimationsEnabled:oldState];
} completion:^(BOOL finished) {
}];