This should be simple for some of you.
I am dismissing a UIViewController
that is presented modally by another UIViewController
from within itself. I am doing this using
[self dismissViewControllerAnimated:YES
completion:^{
// Want to access presentingViewController here.
}];
I tried logging self
's navigationController
, parentViewController
and presentingViewController
, but they all return null
.
Apple's doc says :
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.
According to this, the message is sent to the presentingViewController
. I want to know how to catch this message. Is there a delegate call or how can I go about finding if the presentedViewController was dismissed.