Explore navigation design for iOS

RSS for tag

Discuss the WWDC22 Session Explore navigation design for iOS

Posts under wwdc2022-10001 tag

1 result found
Sort by:
Post not yet marked as solved
1 Replies
1.5k Views
I am currently trying to build a NavigationManager with programmatic navigation. For that I'm using the NavigationPath combined with NavigationDestination. Sadly facing the following issue: navigationDestionation is not being recognised when located in sheet. Im receiving the following message when trying to update the path of the NavigationStack within the sheet. A NavigationLink is presenting a value of type “PathType” but there is no matching navigationDestination declaration visible from the location of the link. The link cannot be activated. Note: Links search for destinations in any surrounding NavigationStack, then within the same column of a NavigationSplitView. Here is some simplified code snipped of the implementation. struct RootView: View { @State private var isPresented: Bool = true var body: some View { Button("Open Modal", action: { self.isPresented.toggle() }) .sheet(isPresented: self.$isPresented, content: { ModalContent() }) } } private struct ModalContent: View { @State private var path = NavigationPath([PathType.configuration]) var body: some View { NavigationStack(path: self.$path) { VStack { Text("Placeholder") } .navigationDestination(for: PathType.self) { pathType in switch pathType { case .configuration: Text("Configuration") default: Color.red } } } } }
Posted
by vazu.
Last updated
.