I had a very similar problem when I deviated programmatically. (for example, when the delegate completed the process).
I used this and it worked perfectly:
if (![self isBeingDismissed]) { [self dismissViewControllerAnimated:YES completion:^{ }]; }
He just checks to see if he has already been fired. Hope this works for you!
source share