Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions guides/GUIDE_FOR_LIBRARY_AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
36 changes: 21 additions & 15 deletions ios/RNSScreenStack.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -905,6 +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;
Expand Down
2 changes: 0 additions & 2 deletions src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading