Hello,
I've been using the @Environment(\.dismiss) var dismiss
in a SwiftUI app for the last 2 years which means it was working as expected in iOS 16, iOS 17 and for the most part iOS 18 up until iOS 18.2.1 in which it is causing an endless loop and eventually a crash.
It seems to be something about using a the @Environment(\.dismiss)
with a NavigationLink
which seems to cause this issue.
When I add a log in my swiftUI views with let _ = Self._printChanges()
, I see the following printed out in a loop:
CurrentProjectView: _dismiss changed.
SurveyView: @self changed.
Similar issues have been reported: https://forums.developer.apple.com/forums/thread/720803 https://forums.developer.apple.com/forums/thread/739512
Any idea how to resolve this ?