From apple docs:
The presenting view controller is responsible for dismissing the view controller it presented. If you call this method on the presented view controller itself, it automatically forwards the message to the presenting view controller.
So you must call this method on presenting VC to dismiss the presented controller. Not presented controller it self. As you can see in above in bold test, if you called this on a presented VC it automatically forwards the method to prsenting VC.
So to answer to your issue,
Call below line on BViewController to dismiss both AViewcontroller
and BViewController
. ,
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
this is Equalent to calling dismissViewController:
on your BaseViewController
. Which is the correct way of dismissing AViewController