From 96760dbfacf4d99f96b787b5abd22dce63529fa9 Mon Sep 17 00:00:00 2001 From: Konrad Michalik Date: Wed, 29 Oct 2025 10:09:34 +0100 Subject: [PATCH 1/3] Bring back gestureResponseDistance on iOS 26 --- ios/RNSScreenStack.mm | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/ios/RNSScreenStack.mm b/ios/RNSScreenStack.mm index 8564033994..bccab38222 100644 --- a/ios/RNSScreenStack.mm +++ b/ios/RNSScreenStack.mm @@ -863,24 +863,21 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer // On iOS < 26, we have a custom full screen swipe recognizer that functions similarily // to interactiveContentPopGestureRecognizer introduced in iOS 26. // On iOS >= 26, we want to use the native one, but we are unable to handle custom animations - // with native interactiveContentPopGestureRecognizer, so we have to fallback to the old implementation. - // In this case, the old one should behave as close as the new native one, having only the difference - // in animation, and without any customization that is exclusive for it (e.g. gestureResponseDistance). + // with native interactiveContentPopGestureRecognizer, so we have to fallback to the old implementation + // for this one case only. if (@available(iOS 26, *)) { - if (customAnimationOnSwipePropSetAndSelectedAnimationIsCustom) { - _isFullWidthSwipingWithPanGesture = YES; - [self cancelTouchesInParent]; - return YES; - } - return NO; - } else { - if ([self isInGestureResponseDistance:gestureRecognizer topScreen:topScreen]) { - _isFullWidthSwipingWithPanGesture = YES; - [self cancelTouchesInParent]; - return YES; + if (!customAnimationOnSwipePropSetAndSelectedAnimationIsCustom) { + return NO; } - return NO; } + + if ([self isInGestureResponseDistance:gestureRecognizer topScreen:topScreen]) { + _isFullWidthSwipingWithPanGesture = YES; + [self cancelTouchesInParent]; + return YES; + } + + return NO; } // Now we're dealing with RNSScreenEdgeGestureRecognizer (or _UIParallaxTransitionPanGestureRecognizer) @@ -905,6 +902,12 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer // it should only recognize with `customAnimationOnSwipe` set return NO; } + if (@available(iOS 26, *)) { + if (gestureRecognizer == _controller.interactiveContentPopGestureRecognizer && + ![self isInGestureResponseDistance:gestureRecognizer topScreen:topScreen]) { + return NO; + } + } // _UIParallaxTransitionPanGestureRecognizer (other...) [self cancelTouchesInParent]; return YES; From 19a30b5b7c6657064f77dfd0fa13f47c52722aa8 Mon Sep 17 00:00:00 2001 From: Konrad Michalik Date: Wed, 29 Oct 2025 10:29:10 +0100 Subject: [PATCH 2/3] Remove comments --- guides/GUIDE_FOR_LIBRARY_AUTHORS.md | 2 -- src/types.tsx | 2 -- 2 files changed, 4 deletions(-) diff --git a/guides/GUIDE_FOR_LIBRARY_AUTHORS.md b/guides/GUIDE_FOR_LIBRARY_AUTHORS.md index 333d135c80..45f8a4a19f 100644 --- a/guides/GUIDE_FOR_LIBRARY_AUTHORS.md +++ b/guides/GUIDE_FOR_LIBRARY_AUTHORS.md @@ -80,8 +80,6 @@ When set to `false` the back swipe gesture will be disabled. The default value i #### `gestureResponseDistance` (iOS only) Use it to restrict the distance from the edges of screen in which the gesture should be recognized. To be used alongside `fullScreenSwipeEnabled`. The responsive area is covered with 4 values: `start`, `end`, `top`, `bottom`. Example usage: -IMPORTANT: Starting from iOS 26, this prop conflicts with the native behavior of full screen swipe to dismiss, therefore it is ignored. - ```tsx gestureResponseDistance: { start: 200, diff --git a/src/types.tsx b/src/types.tsx index 046156f8f5..bbc3056bc1 100644 --- a/src/types.tsx +++ b/src/types.tsx @@ -207,8 +207,6 @@ export interface ScreenProps extends ViewProps { /** * Use it to restrict the distance from the edges of screen in which the gesture should be recognized. To be used alongside `fullScreenSwipeEnabled`. * - * @deprecated since iOS 26, this prop conflicts with the native behavior of full screen swipe to dismiss, therefore it is ignored. - * * @platform ios */ gestureResponseDistance?: GestureResponseDistanceType; From 834a77a7cb69d8e8933dc38b41d1a38cd7bd7fcc Mon Sep 17 00:00:00 2001 From: Konrad Michalik Date: Wed, 29 Oct 2025 11:13:59 +0100 Subject: [PATCH 3/3] add availability check --- ios/RNSScreenStack.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/RNSScreenStack.mm b/ios/RNSScreenStack.mm index bccab38222..91d07c8163 100644 --- a/ios/RNSScreenStack.mm +++ b/ios/RNSScreenStack.mm @@ -902,12 +902,15 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer // it should only recognize with `customAnimationOnSwipe` set return NO; } +#if RNS_IPHONE_OS_VERSION_AVAILABLE(26_0) if (@available(iOS 26, *)) { if (gestureRecognizer == _controller.interactiveContentPopGestureRecognizer && ![self isInGestureResponseDistance:gestureRecognizer topScreen:topScreen]) { return NO; } } +#endif // check for iOS >= 26 + // _UIParallaxTransitionPanGestureRecognizer (other...) [self cancelTouchesInParent]; return YES;