Skip to content

Commit 8403629

Browse files
committed
Simplify
1 parent 552d470 commit 8403629

File tree

5 files changed

+6
-92
lines changed

5 files changed

+6
-92
lines changed

ios/RNSScreen.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#import "RNSScreenContentWrapper.h"
88
#import "RNSScrollEdgeEffectApplicator.h"
99
#import "RNSScrollViewBehaviorOverriding.h"
10-
#import "RNSViewInteractionManager.h"
1110

1211
#if !TARGET_OS_TV
1312
#import "RNSOrientationProviding.h"
@@ -171,12 +170,6 @@ namespace react = facebook::react;
171170
- (BOOL)isModal;
172171
- (BOOL)isPresentedAsNativeModal;
173172

174-
/**
175-
* Holds a shared instance to a service that finds the view that needs to have interactions disabled for stack to not
176-
* have multiple screen transitions at once.
177-
*/
178-
+ (RNSViewInteractionManager *)viewInteractionManagerInstance;
179-
180173
/**
181174
* Tell `Screen` component that it has been removed from react state and can safely cleanup
182175
* any retained resources.

ios/RNSScreen.mm

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,6 @@ - (void)initCommonProps
144144
#endif // RCT_NEW_ARCH_ENABLED
145145
}
146146

147-
+ (RNSViewInteractionManager *)viewInteractionManagerInstance
148-
{
149-
static RNSViewInteractionManager *manager = nil;
150-
static dispatch_once_t onceToken;
151-
dispatch_once(&onceToken, ^{
152-
manager = [[RNSViewInteractionManager alloc] init];
153-
});
154-
155-
return manager;
156-
}
157-
158147
- (BOOL)getFullScreenSwipeShadowEnabled
159148
{
160149
if (@available(iOS 26, *)) {
@@ -807,15 +796,15 @@ - (void)willMoveToWindow:(UIWindow *)newWindow
807796

808797
// Use RNSViewInteractionManager util to find a suitable subtree to disable interations on,
809798
// starting from reactSuperview, because on Paper, self is not attached yet.
810-
[RNSScreenView.viewInteractionManagerInstance disableInteractionsForSubtreeWith:self.reactSuperview];
799+
self.reactSuperview.userInteractionEnabled = false;
811800
}
812801
}
813802

814803
- (void)presentationControllerWillDismiss:(UIPresentationController *)presentationController
815804
{
816805
if (@available(iOS 26, *)) {
817806
// Disable interactions to disallow multiple modals dismissed at once; see willMoveToWindow
818-
[RNSScreenView.viewInteractionManagerInstance disableInteractionsForSubtreeWith:self.reactSuperview];
807+
self.reactSuperview.userInteractionEnabled = false;
819808
}
820809

821810
#if !RCT_NEW_ARCH_ENABLED
@@ -846,7 +835,7 @@ - (void)presentationControllerDidAttemptToDismiss:(UIPresentationController *)pr
846835
{
847836
if (@available(iOS 26, *)) {
848837
// Reenable interactions; see presentationControllerWillDismiss
849-
[RNSScreenView.viewInteractionManagerInstance enableInteractionsForLastSubtree];
838+
self.reactSuperview.userInteractionEnabled = true;
850839
}
851840

852841
// NOTE(kkafar): We should consider depracating the use of gesture cancel here & align
@@ -862,7 +851,7 @@ - (void)presentationControllerDidDismiss:(UIPresentationController *)presentatio
862851
if (@available(iOS 26, *)) {
863852
// Reenable interactions; see presentationControllerWillDismiss
864853
// Dismissed screen doesn't hold a reference to window, but presentingViewController.view does
865-
[RNSScreenView.viewInteractionManagerInstance enableInteractionsForLastSubtree];
854+
self.reactSuperview.userInteractionEnabled = true;
866855
}
867856

868857
if ([_reactSuperview respondsToSelector:@selector(presentationControllerDidDismiss:)]) {
@@ -1666,7 +1655,7 @@ - (void)viewDidAppear:(BOOL)animated
16661655
{
16671656
if (@available(iOS 26, *)) {
16681657
// Reenable interactions, see willMoveToWindow
1669-
[RNSScreenView.viewInteractionManagerInstance enableInteractionsForLastSubtree];
1658+
self.view.reactSuperview.userInteractionEnabled = true;
16701659
}
16711660
[super viewDidAppear:animated];
16721661
if (!_isSwiping || _shouldNotify) {
@@ -1710,7 +1699,7 @@ - (void)viewDidDisappear:(BOOL)animated
17101699
#endif
17111700
if (@available(iOS 26, *)) {
17121701
// Reenable interactions, see willMoveToWindow
1713-
[RNSScreenView.viewInteractionManagerInstance enableInteractionsForLastSubtree];
1702+
self.view.reactSuperview.userInteractionEnabled = true;
17141703
}
17151704
}
17161705

ios/RNSScreenStack.mm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,6 @@ - (void)didMoveToWindow
412412
[self maybeAddToParentAndUpdateContainer];
413413
}
414414
#endif
415-
if (self.window == nil) {
416-
// When hot reload happens that would remove the whole stack, disabling the interaction on a screen out transition
417-
// will not be matched with enabling the interactions on another screen's in transition. We need to make sure
418-
// that the subtree is interactive again
419-
[RNSScreenView.viewInteractionManagerInstance enableInteractionsForLastSubtree];
420-
}
421415
}
422416

423417
- (void)maybeAddToParentAndUpdateContainer

ios/helpers/RNSViewInteractionManager.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

ios/helpers/RNSViewInteractionManager.mm

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)