Adding ios 18 zoom functionality to push screen in RNN with options#8308
Open
markdevocht wants to merge 1 commit into
Open
Adding ios 18 zoom functionality to push screen in RNN with options#8308markdevocht wants to merge 1 commit into
markdevocht wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: iOS 18+ fluid zoom transition for stack push
Summary
Adds support for UIKit’s fluid zoom transition when pushing onto a stack, exposed as
animations.push.zoomin layout options. This lets list → detail flows use the same system zoom morph as native iOS 18+ apps (interactive slow-down, reverse, dismiss-by-drag), without reimplementing the animation in RNN.Motivation
RNN already supports custom hero-style transitions via
sharedElementTransitionson both iOS and Android. That path is flexible but does not match Apple’s system fluid zoom on iOS 18+. Apps that want the Photos-style transition should be able to opt in with a small, declarative API instead of wiringpreferredTransitionin native code themselves.What’s included
ZoomTransitionOptionsandanimations.push.zoomonStackPushAnimationOptions(fromId, optionalenabled).zoomonRNNScreenTransition, resolve source view vianativeID+RNNElementFinder, setdestination.preferredTransitionwithzoomWithOptions:beforepushViewController:animated:(iOS 18+ only).Usage
Tag the source view in React:
On push, pass the same id:
Reverse zoom on pop is handled by UIKit when the detail screen is popped; no
animations.pop.zoomis required.Behavior and constraints
sharedElementTransitionsfor a similar hero effect.animations.pushonly — notpop,setStackRoot, or modals in this change.animated: trueand zoom is enabled with a non-emptyfromId.sharedElementTransitions,content,topBar, orelementTransitionscustom animations are set on the same push, zoom is not applied (hasCustomAnimationtakes precedence).UIViewController.preferredTransition/ system zoom — not RNN’sScreenAnimationControllershared-element animator.Relationship to existing animations
sharedElementTransitions— RNN custom hero on iOS and Android;fromId+toId, configurable duration/interpolation. Still the right choice for cross-platform hero animations or fine-grained control.animations.push.zoom— iOS 18+ system transition; singlefromIdmatchingnativeID; native look and interaction.These are intentionally separate APIs; do not combine them on the same push if you want zoom.
iOS example:
