Add left-to-right push animation support#1
Open
kartikeyajar wants to merge 2 commits intoflowstacks-0.3.5from
Open
Add left-to-right push animation support#1kartikeyajar wants to merge 2 commits intoflowstacks-0.3.5from
kartikeyajar wants to merge 2 commits intoflowstacks-0.3.5from
Conversation
…ot respecting push direction Split single animation flag into separate push/pop flags so each screen remembers how it was pushed.
kunal-jar
reviewed
Apr 16, 2026
| extension View { | ||
| func customNavigationTransition(useLeftToRightForPush: Bool, useLeftToRightForPop: Bool) -> some View { | ||
| #if os(iOS) | ||
| let delegate = CustomNavigationControllerDelegate() |
There was a problem hiding this comment.
should we create CustomNavigationControllerDelegate() on every function call, or we should use a singleton or something?
There was a problem hiding this comment.
with this implementation, every view rendering it will create new instance of CustomNavigationControllerDelegate. View rendering will happen on view initialisation, view updates, state update, Animation.
Singleton will not be thread safe in this case.
Recommended to create a container which holds with delegate and allow that container to access the NavigationControllerAccessor
kunal-jar
reviewed
Apr 16, 2026
| if let navigationController = uiViewController.navigationController { | ||
| navigationController.delegate = delegate | ||
| } else { | ||
| DispatchQueue.main.async { |
| } | ||
|
|
||
| func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { | ||
| return 0.35 |
There was a problem hiding this comment.
instead of hardcoding this value, please use it from a var, may that can be passed from outside.
665ce57 to
aa4e1d4
Compare
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.
Summary
.pushLeftToRightnavigation style for reverse push animationsChanges
New Navigation Style
.pushLeftToRightcase toRouteenum andRouteStyleImplementation Details
NavigationControllerDelegate.swiftwith customUIViewControllerAnimatedTransitioningNavigationControllerModifier.swiftfor SwiftUI integration#if os(iOS)directives)Usage
routes.pushLeftToRight(screen)- Push with left-to-right animationnavigator.pushLeftToRight(screen)- Convenience method on FlowNavigator