I have some code to clean up in my viewWillDisappear:
, which I only want to use when the view is moving back to the parent view controller.
- (void)
viewController.isBeingPresented == NO; [rootVC presentViewController:viewController animated:NO completion:^{ viewController.isBeingPresented == NO; viewController.isBeingDismissed == NO; [viewController dismissViewControllerAnimated:NO completion:^{ viewController.isBeingDismissed == NO; }]; viewController.isBeingDismissed == NO; // is not work }]; viewController.isBeingPresented == YES; // is work
viewController.isBeingPresented == NO;
[rootVC presentViewController:viewController animated:NO completion:^{
viewController.isBeingPresented == NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
viewController.isBeingDismissed == NO;
[viewController dismissViewControllerAnimated:NO completion:^{
viewController.isBeingDismissed == NO;
}];
viewController.isBeingDismissed == YES; // is work
});
}];
viewController.isBeingPresented == YES; // is work