[self dismissViewControllerAnimated:YES completion:^{
[(UINavigationController *)self.presentingViewController popToRootViewControllerAnimated:YES];
}];
This code work fine for me,
Important:
the viewController
must be presented by the navigationController
. (In most cases)
If not, call self.presentingViewController.navigationController
.