I have a view hierarchy with multiple UINavigationControllers
Now from a particular view controller, I wanted to pop to window.rootviewcontroller
How can I do that?
I tried
[UIApplication sharedApplication].keyWindow.rootViewController popToRootViewController];
But it does not work. Please suggest.
Please note I want to go to window.rootVC.
THis will not work for me
[self.navigationController popToRootViewControllerAnimated:YES];
set
Just get the window instance and set the root view controller again, as
popToRootViewController
only pops to root view controller of particular navigation stackHope this helps.