Post

Replies

Boosts

Views

Activity

Reply to Can't find any realistic example of how to use NavigationPath
Having just added NavigationPath functionality to my app so that I can dismiss an arbitrary view and return to the previous, here are some thoughts: Make sure that you are passing a binding to your child views, i.e. UserFindingView(viewPathController: $viewStack ... All of your NavigationLinks must be the navigationDestination-dependent form (what the documentation calls "presentation links", with an associated value and a .navigationDestination modifier somewhere up the view stack to handle that value type. Note also that the top-most .navigationDestination that can handle the value's type will do so. Because of both points in #2, if you have pre-existing NavigationLinks that aren't already operating on a unique type, you'll need to create one for those. I used per-link enum types for mine.
Topic: UI Frameworks SubTopic: SwiftUI
Mar ’25
Reply to Selecting TextField Causes Application Hang on Device
Wow, you are totally correct. Simply removing the two @Environment(\.dismiss) private var dismiss lines makes the hang go away, despite the fact that I wasn't even invoking the dismiss instance. Is this a known issue? The documentation says that this action is used to pop the current view from a NavigationStack. I assume that my alternative is to use NavigationPath bindings instead?
Topic: UI Frameworks SubTopic: SwiftUI
Mar ’25