diff --git a/apple/RNGestureHandlerModule.mm b/apple/RNGestureHandlerModule.mm index 2e8c2f2f2a..2d93938aea 100644 --- a/apple/RNGestureHandlerModule.mm +++ b/apple/RNGestureHandlerModule.mm @@ -10,7 +10,6 @@ #ifdef RCT_NEW_ARCH_ENABLED #import #import -#import #import #import #import @@ -34,7 +33,7 @@ #endif // RCT_NEW_ARCH_ENABLED #ifdef RCT_NEW_ARCH_ENABLED -@interface RNGestureHandlerModule () +@interface RNGestureHandlerModule () @end #else @@ -68,9 +67,7 @@ - (void)invalidate _manager = nil; -#ifdef RCT_NEW_ARCH_ENABLED - [self.bridge.surfacePresenter removeObserver:self]; -#else +#ifndef RCT_NEW_ARCH_ENABLED [self.bridge.uiManager.observerCoordinator removeObserver:self]; #endif // RCT_NEW_ARCH_ENABLED } @@ -115,9 +112,7 @@ - (void)setBridge:(RCTBridge *)bridge eventDispatcher:bridge.eventDispatcher]; _operations = [NSMutableArray new]; -#ifdef RCT_NEW_ARCH_ENABLED - [bridge.surfacePresenter addObserver:self]; -#else +#ifndef RCT_NEW_ARCH_ENABLED [bridge.uiManager.observerCoordinator addObserver:self]; #endif // RCT_NEW_ARCH_ENABLED } @@ -243,27 +238,7 @@ - (void)addOperationBlock:(GestureHandlerOperation)operation [_operations addObject:operation]; } -#pragma mark - RCTSurfacePresenterObserver - -#ifdef RCT_NEW_ARCH_ENABLED - -- (void)didMountComponentsWithRootTag:(NSInteger)rootTag -{ - RCTAssertMainQueue(); - - if (_operations.count == 0) { - return; - } - - NSArray *operations = _operations; - _operations = [NSMutableArray new]; - - for (GestureHandlerOperation operation in operations) { - operation(self->_manager); - } -} - -#else +#ifndef RCT_NEW_ARCH_ENABLED #pragma mark - RCTUIManagerObserver