Explore navigation design for iOS

RSS for tag

Discuss the WWDC22 Session Explore navigation design for iOS

Posts under wwdc2022-10001 tag

9 Posts

Post

Replies

Boosts

Views

Activity

NavigationStack not working correctly in sheet
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 } } } } }
1
1
2.2k
May ’23
Navigation Destination not working
I got the error: A NavigationLink is presenting a value of type “FormTemplate” but there is no matching navigationDestination declaration visible from the location of the link. The link cannot be activated. This problem is only occurring on iPhone, on iPad works fine. I was following the documentation, and can't find the error. That's my base tabbar view: TabView { ForEach(menuData, id: \.title) { item in NavigationStack { item.view } .tabItem { Text(item.title) Image(systemName: item.icon) } .tag(item.title) } } The menu view: ScrollView { VStack (spacing: 12) { ForEach(lstMenu, id: \.title) { tV in NavigationLink(destination: tv.view, tag: tv.title, selection: $selection) { rowView } } } .navigationTitle("Segurança") .padding(.top, 20) .padding(.trailing, 20) .padding(.leading, 20) } .navigationTitle("Segurança") The list view: List { ForEach($viewModel. forms), id: \.documentId) { form in NavigationLink(value: form) { NameContentRow(entity: form) .frame(height: 75) .contentShape(Rectangle()) } } } .navigationDestination(for: FormTemplate.self) { form in EventFormResponseList(form: form) .vlPermissions(permissions) } .refreshable { fetch(onPullToRefresh: true) } .listStyle(.insetGrouped) .navigationBarTitleDisplayMode(.inline) .navigationBarTitle("Formulários de eventos") .padding(.horizontal, sizeClass == .compact ? 0 : 20) .padding(.top, sizeClass == .compact ? 0 : 16) .task { viewModel.loadFormTemplate(completion: { _ in }) }
0
1
1.7k
Nov ’22
About Drawing Maps In CarpPlay
I want to draw directions to a specific location in CarPlay. I realized that there are two different options that can be made regarding this. First of all, drawing a direct route from current location to the desired location. The second is to draw the route after showing our current location and selecting the location which we want to go on the map. Which would make more sense for me to do? Which authorization is appropriate for the situations I have mentioned? com.developer.apple.carplay-parking or com.developer.apple.carplay-maps? Parking or Map? If you developing an CarPlay Application I would appreciate it if you would also write about the resources you used on the subject. If you have knowledge about this subject, I am waiting for your answers ASAP! Thanks :)
0
0
1.1k
Oct ’22
A navigationDestination for <App.Entity> was declared earlier on the stack. Only the destination declared closest to the root view of the stack will be used.
anyone been able to get rid of this error? A navigationDestination for <App.Entity> was declared earlier on the stack. Only the destination declared closest to the root view of the stack will be used. Seems to happen when im using a NavigationLink(value:) and a NavigationLink(destination:) in the same class. I'd think it would make sense to be able to use both methods? ios16 b5
1
0
3.6k
Aug ’22
NavigationLink inside NavigationSplitView strange behaviours
I have a very simple NavigationSplitView setup. The first time you press the NavigationLink it pushes the next view, but then immediately dismisses it. Tap it again and it correctly pushes and stays on screen. Then when tapping the second NavigationLink it pushes a view but just shows a yellow warning triangle and not the text. Then when pressing the back button, it shows the initial view first, then the second view 🤷‍♂️ This is on iOS 16 beta 4. Any idea what is going on here? struct ContentView: View {     @State var splitViewVisibility: NavigationSplitViewVisibility = .all     var body: some View {         NavigationSplitView(columnVisibility: $splitViewVisibility) {             List {                 NavigationLink("First", destination: DetailView(string: "First"))             }         } detail: {             Text("Select the first view from the list")         }         .navigationSplitViewStyle(.balanced)     } } struct DetailView: View {     var string: String     var body: some View {         NavigationStack() {             List {                 NavigationLink("Second", value: "Second")             }             .navigationDestination(for: String.self, destination: { string in                 Text(string)             })         }         .navigationTitle(string)     } }
1
2
2.9k
Aug ’22
Back supported Navigation-View
Is there any convenient way to back deploy the NavigationStack or NavigationSplitView?? The real problem is if I want to back support iOS 15 or 14, I must conditionally switch between NavigationView and NavigationStack / NavigationSplitView. Here is how I did for NavigationStack, but I have no idea how to deal with NavigationSplitView import SwiftUI struct NavigationStack<Content: View>: View {     var content: () -> Content     var body: some View {         if #available(iOS 16.0, macOS 13.0, *) {             SwiftUI.NavigationStack {                 content()             }         } else {             NavigationView {                 content()             }.navigationViewStyle(.stack)         }     } } Will the new NavigationStack and NavigationSplitView back support old devices? I think these behaviors in previous OS is not new features.
1
0
1.6k
Jul ’22
NavigationStack not working correctly in sheet
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 } } } } }
Replies
1
Boosts
1
Views
2.2k
Activity
May ’23
Navigation Destination not working
I got the error: A NavigationLink is presenting a value of type “FormTemplate” but there is no matching navigationDestination declaration visible from the location of the link. The link cannot be activated. This problem is only occurring on iPhone, on iPad works fine. I was following the documentation, and can't find the error. That's my base tabbar view: TabView { ForEach(menuData, id: \.title) { item in NavigationStack { item.view } .tabItem { Text(item.title) Image(systemName: item.icon) } .tag(item.title) } } The menu view: ScrollView { VStack (spacing: 12) { ForEach(lstMenu, id: \.title) { tV in NavigationLink(destination: tv.view, tag: tv.title, selection: $selection) { rowView } } } .navigationTitle("Segurança") .padding(.top, 20) .padding(.trailing, 20) .padding(.leading, 20) } .navigationTitle("Segurança") The list view: List { ForEach($viewModel. forms), id: \.documentId) { form in NavigationLink(value: form) { NameContentRow(entity: form) .frame(height: 75) .contentShape(Rectangle()) } } } .navigationDestination(for: FormTemplate.self) { form in EventFormResponseList(form: form) .vlPermissions(permissions) } .refreshable { fetch(onPullToRefresh: true) } .listStyle(.insetGrouped) .navigationBarTitleDisplayMode(.inline) .navigationBarTitle("Formulários de eventos") .padding(.horizontal, sizeClass == .compact ? 0 : 20) .padding(.top, sizeClass == .compact ? 0 : 16) .task { viewModel.loadFormTemplate(completion: { _ in }) }
Replies
0
Boosts
1
Views
1.7k
Activity
Nov ’22
About Drawing Maps In CarpPlay
I want to draw directions to a specific location in CarPlay. I realized that there are two different options that can be made regarding this. First of all, drawing a direct route from current location to the desired location. The second is to draw the route after showing our current location and selecting the location which we want to go on the map. Which would make more sense for me to do? Which authorization is appropriate for the situations I have mentioned? com.developer.apple.carplay-parking or com.developer.apple.carplay-maps? Parking or Map? If you developing an CarPlay Application I would appreciate it if you would also write about the resources you used on the subject. If you have knowledge about this subject, I am waiting for your answers ASAP! Thanks :)
Replies
0
Boosts
0
Views
1.1k
Activity
Oct ’22
Reload tableview IOS15 Issue
I working with table view on IOS 14 work well. But on IOS 15 reload data has a bug overlay label on cell.
Replies
0
Boosts
0
Views
989
Activity
Sep ’22
A navigationDestination for <App.Entity> was declared earlier on the stack. Only the destination declared closest to the root view of the stack will be used.
anyone been able to get rid of this error? A navigationDestination for <App.Entity> was declared earlier on the stack. Only the destination declared closest to the root view of the stack will be used. Seems to happen when im using a NavigationLink(value:) and a NavigationLink(destination:) in the same class. I'd think it would make sense to be able to use both methods? ios16 b5
Replies
1
Boosts
0
Views
3.6k
Activity
Aug ’22
NavigationLink inside NavigationSplitView strange behaviours
I have a very simple NavigationSplitView setup. The first time you press the NavigationLink it pushes the next view, but then immediately dismisses it. Tap it again and it correctly pushes and stays on screen. Then when tapping the second NavigationLink it pushes a view but just shows a yellow warning triangle and not the text. Then when pressing the back button, it shows the initial view first, then the second view 🤷‍♂️ This is on iOS 16 beta 4. Any idea what is going on here? struct ContentView: View {     @State var splitViewVisibility: NavigationSplitViewVisibility = .all     var body: some View {         NavigationSplitView(columnVisibility: $splitViewVisibility) {             List {                 NavigationLink("First", destination: DetailView(string: "First"))             }         } detail: {             Text("Select the first view from the list")         }         .navigationSplitViewStyle(.balanced)     } } struct DetailView: View {     var string: String     var body: some View {         NavigationStack() {             List {                 NavigationLink("Second", value: "Second")             }             .navigationDestination(for: String.self, destination: { string in                 Text(string)             })         }         .navigationTitle(string)     } }
Replies
1
Boosts
2
Views
2.9k
Activity
Aug ’22
Back supported Navigation-View
Is there any convenient way to back deploy the NavigationStack or NavigationSplitView?? The real problem is if I want to back support iOS 15 or 14, I must conditionally switch between NavigationView and NavigationStack / NavigationSplitView. Here is how I did for NavigationStack, but I have no idea how to deal with NavigationSplitView import SwiftUI struct NavigationStack<Content: View>: View {     var content: () -> Content     var body: some View {         if #available(iOS 16.0, macOS 13.0, *) {             SwiftUI.NavigationStack {                 content()             }         } else {             NavigationView {                 content()             }.navigationViewStyle(.stack)         }     } } Will the new NavigationStack and NavigationSplitView back support old devices? I think these behaviors in previous OS is not new features.
Replies
1
Boosts
0
Views
1.6k
Activity
Jul ’22
navigationDestination(for:destination:)
Hi, I'm rebuilding my app's architecture from NavigationView to NavigationStack, and i'm in trouble to pass a destination (inside the navigationDestination) who need a Binding Value. Any Help?
Replies
0
Boosts
0
Views
889
Activity
Jun ’22
Top Nav Bar SwiftUI
I have been watching a session called “Meet desktop-class iPad” and wondered what would be the easiest way to implement it? I am on Swift Playgrounds iPad Pro.
Replies
0
Boosts
0
Views
1.2k
Activity
Jun ’22