Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
kkafar committed Jun 27, 2024
1 parent 0409fa8 commit 703d2e7
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions ios/RNSScreenStack.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1211,21 +1211,27 @@ - (void)prepareForRecycle
#else
#pragma mark - Paper specific

- (void)invalidate {
- (void)invalidate
{
_invalidated = YES;
[self dismissAllPresentedViewControllersFrom:_controller completion:^{
// Ensure presented modals are removed and the controller is detached from its parent
[self->_presentedModals removeAllObjects];
[self->_controller willMoveToParentViewController:nil];
[self->_controller removeFromParentViewController];
}];
[self dismissAllPresentedViewControllersFrom:_controller
completion:^{
// Ensure presented modals are removed and the controller is detached from its
// parent
[self->_presentedModals removeAllObjects];
[self->_controller willMoveToParentViewController:nil];
[self->_controller removeFromParentViewController];
}];
}

- (void)dismissAllPresentedViewControllersFrom:(UIViewController *)viewController completion:(void (^)(void))completion {
- (void)dismissAllPresentedViewControllersFrom:(UIViewController *)viewController completion:(void (^)(void))completion
{
if (viewController.presentedViewController) {
[viewController.presentedViewController dismissViewControllerAnimated:YES completion:^{
[self dismissAllPresentedViewControllersFrom:viewController completion:completion];
}];
[viewController.presentedViewController
dismissViewControllerAnimated:YES
completion:^{
[self dismissAllPresentedViewControllersFrom:viewController completion:completion];
}];
} else {
completion();
}
Expand Down

0 comments on commit 703d2e7

Please sign in to comment.