This is the simple code I am calling to go back to rootViewController
of UINavigationController
:
-(void)viewWillDisappear:(BOOL)animated
{
[self.navigationController popToRootViewControllerAnimated:YES];
[super viewWillDisappear:animated];
}
But the back navigation occurs one by one.
Say I have 3 viewControllers - A, B, C.
A -> B -> C
What I want on back of C is :
C -> A
But on using popToRootViewControllerAnimated, this is how back navigation appears :
C -> B -> A