I'm trying to dismiss a view controller like this:
[composeViewController dismissViewControllerAnimated:YES completion:^{
NSLog(@"Hello"); // Never outputted
}];
The view controller is dismissed, but for some reason the completion block is never called.
I have never had any issues with completion block not being called with other view controllers.
This view controller is "special" though, because it's added as a child view controller (which I have not worked with previously in my app). Does this impose any side effects why the completion block is not called?
It's added like this:
UIViewController *rootVC = [UIApplication sharedApplication].delegate.window.rootViewController;
[rootVC addChildViewController:self];
[rootVC.view addSubview:self.view];
[self didMoveToParentViewController:rootVC];
addChildViewController:
actually pushes that view controller onto the navigation stack. You have to pop it off before that block can fire – CodaFi[composeViewController removeFromParentViewController];
(I can see that it's removed fromchildViewControllers
property ofrootViewController
) before callingdismiss...
but the completion block is still not called. – Peter Warbo-presentViewController...
but this view controller I'm using is from an external source so I don't have any control over how they want it to be presented. – Peter Warbo