-
Notifications
You must be signed in to change notification settings - Fork 159
Track VCs being popped from stack from UIKit #243
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
base: main
Are you sure you want to change the base?
Conversation
Tapping the back button or interactively popping via gesture can conflict with observation when the view controller being popped to executes a mutation in its `will`- or `didAppear`. While this isn't common in vanilla UIKit, in TCA sending even a no-op action in these lifecycle hooks can lead to immediately re-pushing the view controller that was just popped. This commit does what it can to detect when the back button was pushed or the interactive pop gesture was invoked so that if/when the pop is committed, we can update the path more eagerly, avoiding the re-presentation.
@mbrandonw Would be nice to write some tests for this but not sure how easy it will be given:
|
Hi, I think I'm running into the issue this PR is trying to fix, when using the iOS 18+ zoom transition in UIKit. I've modified the initializer of StaticNavigationStackController in the "Static Path" case study to be similar to my situation like so:
When dismissing a controller by swiping, or just pressing the back button, and pushing a new controller while the transition is still running will re-push the currently transitioning controller. When actually providing a source view, like a cell in a collection view in my case, this is very easy to trigger. The transition is quite long. I've attached a recording of the modified StaticNavigationStackController example. I Hope this is helpful. Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-08-08.at.18.28.20.mov |
Tapping the back button or interactively popping via gesture can conflict with observation when the view controller being popped to executes a mutation in its
will
- ordidAppear
. While this isn't common in vanilla UIKit, in TCA sending even a no-op action in these lifecycle hooks can lead to immediately re-pushing the view controller that was just popped.This commit does what it can to detect when the back button was pushed or the interactive pop gesture was invoked so that if/when the pop is committed, we can update the path more eagerly, avoiding the re-presentation.