Detached view controller while routing to alert #19
Unanswered
OrangeWatch
asked this question in
Q&A
Replies: 1 comment
-
@OrangeWatch This would seem to be a SwiftUI limitation, of which there are many when it comes to navigation, unfortunately. We've reported a bunch of feedback to Apple for various navigation issues, and we hope that some are solved this coming WWDC. Our recommendation would be to try to reproduce the issue in vanilla SwiftUI (that is, without our library obscuring anything) and then report that as feedback to Apple. If you have trouble reproducing in SwiftUI, let us know here 😄 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I encountered problems with routing. Change of route can lead to inconsistent state in some scenarios.
I prepared example to demonstrate the issue. There are two possible routes for
ContentView
. InContentViewModel
I simulate start of the app with given route (navigationLink
case). After some time is route programatically changed (alert
case). Here is example code:The problem is with switching route to
alert
whennavigationLink
route is active. Becausealert
is being presented onnavigationLink
that is meanwhile being popped, I get this error:This basically leads to inconsistency of state, because result of this situation is that:
route
== nilThis was only the simplest situation possible but it seems that it can cause a lot of problems in more complex apps (e.g. presenting alerts on different tabs).
Did you encounter this kind of issue? Maybe this is not the proper way of routes usage?
Thank you for your thoughts! I appreciate your work 💪
Beta Was this translation helpful? Give feedback.
All reactions