Given this View:
struct ContentView: View {
@State var link1Active: Bool = false
var body: some View {
NavigationView {
List {
NavigationLink(destination: Text("Link1 Destination"), isActive: $link1Active) {
Text("Click me 1")
}
NavigationLink(destination: Text("Link2 Destination")) {
Text("Click me 2")
}
}
Text("View 1")
Text("View 2")
}
.onAppear {
link1Active = true
print("in here!")
}
}
}
When the app starts on iPad in landscape mode, I see two columns "View 1" and "View2".
I would expect to see "Link 1 Destination" in the left column, but its not shown.
However when I click the toggle sidebar button the "View 1" is replaced.
Is this an issue with the way the views are setup in swiftui?