Replies: 2 comments 2 replies
-
Ah, sorry, Brandon and Stephen, I mistakenly made this into a discussion rather than an issue report. |
Beta Was this translation helpful? Give feedback.
2 replies
-
You're correct, @mbrandonw. It's not a TCA bug. Here's the version of the toy app, using Thanks again. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hello :)
In our app, we found an issue where a push navigation freezes under a very strange set of conditions and our investigation points to TCA as being the source of the problem.
I'm attaching to this message a zipped project containing two versions of a toy app, one built using TCA and the other built using vanilla SwiftUI. The TCA version has the issue, the other doesn't.
Our app is very modular and each scene is a separate SPM module. We also have "utility" modules, one of which is for reusable views and other view goodies (
ViewUtilities
).One of these reusable views is a custom web view that uses a
UIViewControllerRepresentable
to embed aSFSafariViewController
inside a SwiftUI view, but is nothing out of the ordinary.One of the scenes has in its view a declaration for
@Environment(\.dismiss)
, even though it's not actually used in the toy app (we do use it in our app).The toy app is then a radically stripped-off version of our app, keeping only the absolute minimum needed to replicate the issue, with names changed.
With that preamble out of the way, the set of necessary conditions that cause the freeze is bizarre:
@Environment(\.dismiss) var dismiss
declared in the view, even without being usedViewUtilities
module in the package manifest, as a dependency of the module that has@Environment(\.dismiss)
in its scene's view, even if theViewUtilities
module is not actually being imported by the module declaring that dependencySFSafariViewController
in theViewUtilities
module's custom web view.Comment away the
dismiss
property inScreen2
's view, or comment away the inclusion ofViewUtilities
as a dependency in theScreen2
module, or use a view controller other thanSFSafariViewController
and the problem goes away in the TCA version of the toy app.In the vanilla SwiftUI version of the toy app, however, having all 3 of the above conditions works fine and there is no freeze.
The project has a
notes.txt
file with a couple more details.Thanks for looking it over.
freeze.mp4
Dismiss issue.zip
Beta Was this translation helpful? Give feedback.
All reactions