Commit 32050b9
feat(iOS): Handle interactiveContentPopGesture for iOS 26 (#3173)
## Description
Resolves
software-mansion/react-native-screens-labs#369,
might resolve
#3161,
reverts
#3141,
#3142
This PR attempts to enable interactiveContentPopGestureRecognizer for
iOS 26 to achieve native screen popping behavior. Until 26, the default
was to swipe from the edge of the screen. We had the option to do
fullscreen switch, which was controlled by a `fullScreenSwipeEnabled`
prop. Since the default behavior has changed, this prop, along with
`gestureResponseDistance`, is being ignored from now on.
New iOS allows for popping multiple screens almost at once, which we
still cannot support due to asynchronous nature of stack updates coming
from host to JS that would create a "feedback loop" in situation like
the following: host pops 1. screen + sends update, pops 2. screen +
sends update -> JS acknowledges 1. update + sends updated state -> host
gets 2. screen from JS and pushes it again. This PR attempts to block
more than 1 pop at once by removing interactions from the whole screen.
As a (desired) side effect, this also disables interactions on the
screen below the one that is popped until the transition finishes.
## Changes
- removed `RNSPanGestureRecognizer` from iOS 26 build and replace it
with native `interactiveContentPopGestureRecognizer`
- disabled all interactions when screens are in transition
- updated docs
## Test code and steps to reproduce
Use Test3173 to test swipe and interactions on bare screens API &
compare with any other test that uses react-navigation stack, i.e
Test3093. Use Test3093 with additional screenOptions:
```ts
{
animation: 'slide_from_bottom',
animationMatchesGesture: true,
}
```
to test custom animations on swipe back.
---------
Co-authored-by: Kacper Kafara <[email protected]>1 parent cc3ae97 commit 32050b9
File tree
6 files changed
+188
-95
lines changed- apps/src/tests
- guides
- ios
- src
6 files changed
+188
-95
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
143 | 155 | | |
144 | 156 | | |
145 | 157 | | |
| |||
731 | 743 | | |
732 | 744 | | |
733 | 745 | | |
734 | | - | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
735 | 759 | | |
736 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
737 | 767 | | |
738 | 768 | | |
739 | 769 | | |
| |||
746 | 776 | | |
747 | 777 | | |
748 | 778 | | |
749 | | - | |
750 | 779 | | |
| 780 | + | |
751 | 781 | | |
752 | 782 | | |
753 | 783 | | |
| |||
759 | 789 | | |
760 | 790 | | |
761 | 791 | | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
762 | 797 | | |
763 | 798 | | |
764 | 799 | | |
| |||
769 | 804 | | |
770 | 805 | | |
771 | 806 | | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
772 | 813 | | |
773 | 814 | | |
774 | 815 | | |
| |||
1529 | 1570 | | |
1530 | 1571 | | |
1531 | 1572 | | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
1532 | 1577 | | |
1533 | 1578 | | |
1534 | 1579 | | |
| |||
0 commit comments