-
-
Notifications
You must be signed in to change notification settings - Fork 587
feat(iOS): Bring back fullScreenSwipeEnabled prop #3242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update docs in src/types.tsx
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good. I have some requests though. Please answer them.
Good job!
guides/GUIDE_FOR_LIBRARY_AUTHORS.md
Outdated
For iOS prior to 26, swiping with this option results in the same transition animation as `simple_push` by default. | ||
It can be changed to other custom animations with `customAnimationOnSwipe` prop, but default iOS swipe animation | ||
is not achievable due to usage of custom recognizer. | ||
|
||
For iOS 26 and up, native `interactiveContentPopGestureRecognizer` is used, and this prop controls whether it should | ||
be enabled or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get impression from this description that customAnimationOnSwipe
does not work anymore on iOS 26 & I remember from testing that was not the case, was it?
If it still works, we should rephrase the description so that it indicates that customAnimationOnSwipe
is possible in both cases but it results in new native gesture recognizer not being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ios/RNSScreen.h
Outdated
/** | ||
* Returns a boolean equivalent of fullScreenSwipeEnabled OptionalBoolean, resolves Undefined as `false` for iOS < 26, | ||
* `true` otherwise. | ||
*/ | ||
- (BOOL)fullScreenSwipeEnabledBoolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this approach here. Please take a look how obscureBackground
, which also uses RNSOptionalBoolean is implemented & follow that pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat different, because the value is used in RNSScreenStack, and for obscureBackground there is no usages outside of the context it's declared in. Could you point me in some direction here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I could see fullScreenSwipeEnabled
property being readonly
, overwrite the getter to return appropriate BOOL
value & we do not need any additional method here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backing field can be of RNSOptionalBoolean
type obviously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
62e1a05
I'm still not sure we understand each other, please take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Responded to your question
ios/RNSScreen.h
Outdated
/** | ||
* Returns a boolean equivalent of fullScreenSwipeEnabled OptionalBoolean, resolves Undefined as `false` for iOS < 26, | ||
* `true` otherwise. | ||
*/ | ||
- (BOOL)fullScreenSwipeEnabledBoolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I could see fullScreenSwipeEnabled
property being readonly
, overwrite the getter to return appropriate BOOL
value & we do not need any additional method here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon request, revisiting my approach here
@kkafar @kmichalikk is it possible to use this prop with a vertical scroll view? somehow if i have scroll view from the gesture handler in the screen it won't swipe on iOS 26. only on the very edge. |
Description
Resolves [iOS] Bring back fullScreenSwipeEnabled on iOS 26.
This PR brings back
fullScreenSwipeEnabled
prop on iOS 26. The type of the prop is changed internally to OptionalBoolean with default value differing between versions.Test code and steps to reproduce
Use
Test3093