in my iOS App i need to change the rootviewController of the window in between of app .so when i change my rootviewcontroller dyncamically its flicking the view before its change.but what i want is to give a smooth transition when rootviewcontroller is changed.
i had tried with the following but its not the transition i want.
[UIView transitionWithView:self.window
duration:.8
options:UIViewAnimationOptionTransitionCurlUp
animations:^{
self.window.rootViewController = tabBarControllerMain;
[self.window makeKeyAndVisible];
}
completion:NULL];
i want specific transition like navigationcontroller pushview transition.
can any body give me idea how to achieve that?
Based on this Apple's documentation
Swift
Basing on Hardik Darji's answer I've created UIWindow extension to swap rootViewController with configurable animation type that simulates system animations - push, pop, present and dismiss.
Swift 3.
}
Here is code in Swift for how to make Push and Pop animation in rootviewcontroller.
Hope this helps...