I have created a sample project to explain this better.
When you open the settings app on iPad, the right side of the screen shows the general settings and the left side shows the general settings navigation link selected
But when people open my app on the right side of the screen is the “Hello” page but on the left, the hello navigation link is not selected
My code:
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
PrimaryView()
HelloView()
}
}
}
struct PrimaryView: View {
var body: some View {
List {
NavigationLink("Hello", destination: HelloView())
NavigationLink("World", destination: WorldView())
}
.listStyle(InsetGroupedListStyle())
}
}
struct HelloView: View {
var body: some View {
List {
Text("Hello")
}.navigationTitle("Hello")
}
}
struct WorldView: View {
var body: some View {
List {
Text("World")
}.navigationTitle("World")
}
}
I tried to find the answer to this on Google, but I probably just didn’t know the right keywords
Thanks in advance :)