presentedViewController must be used on main thread only

This commit is contained in:
Khan, Arshad 2020-10-08 16:59:20 +05:30
parent db6ba46810
commit 223e259951

View File

@ -117,11 +117,14 @@
} }
- (void)removeCurrentViewController { - (void)removeCurrentViewController {
if (self.viewControllerToPresentOn.presentedViewController) { [MVMCoreDispatchUtility performBlockOnMainThread:^{
[[MVMCoreNavigationHandler sharedNavigationHandler] dismissTopViewControllerAnimated:YES]; // presentedViewController must be used on main thread
} else { if (self.viewControllerToPresentOn.presentedViewController) {
[[MVMCoreNavigationHandler sharedNavigationHandler] popTopViewControllerAnimated:YES]; [[MVMCoreNavigationHandler sharedNavigationHandler] dismissTopViewControllerAnimated:YES];
} } else {
[[MVMCoreNavigationHandler sharedNavigationHandler] popTopViewControllerAnimated:YES];
}
}];
} }
#pragma mark - Navigation Simple #pragma mark - Navigation Simple