-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use of SwiftUI's @Environment(\.dismiss)
causes infinite loop if okta-mobile-swift is listed as a dependency
#163
Labels
bug
Something isn't working
Comments
Same issue I'm facing with Scanner Module import SwiftUI struct ScannerView: View {
} import SwiftUI struct DataScannerView: UIViewControllerRepresentable {
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug?
I've run into a very particular bug where a SwiftUI iOS app will freeze and the CPU and memory usage will rapidly climb in a way consistent with something infinitely looping. It happens under these circumstances:
@Environment(\.dismiss) private var dismiss
variable defined (doesn't even need to be used)NavigationLink
to another View that must have a class member variable, usually this would be a view model. (structs do not cause the crash).When the user presses the control associated with the
NavigationLink
the app will immediately freeze and resource consumption will rapidly climb. If you remove any of the above variables (including the use ofokta-mobile-swift
as a dependency) the freeze will disappear.What is expected to happen?
When the
NavigationLink
is pressed the view should be pushed to the destination view as usualWhat is the actual behavior?
The app immediately freezes and resource consumption climbs. You can put a breakpoint on the
NavigationLink
and see it keeps getting called over and over again.Reproduction Steps?
okta-mobile-swift
dependency to the project (I used the latest version)RootView
as the root view and add the following code:Additional Information?
No response
SDK Version(s)
Verified on 1.3.0 and 1.5.0
Build Information
No response
The text was updated successfully, but these errors were encountered: