This happens if i declare the environment variable .presentationMode and set .navigationBarItems(trailing…
struct MasterView: View {
var body: some View {
NavigationView {
NavigationLink("Go", destination: DetailView())
.navigationBarTitle("Master")
}
}
}
struct DetailView: View {
@Environment(\.presentationMode) var presentation
var body: some View {
Text("Detail view")
.navigationBarTitle("Detail")
.navigationBarItems(trailing: Button("Close") { })
}
}
If comment out line 11 or 16, navigation works fine.
Post
Replies
Boosts
Views
Activity
Edit:
If comment out line 11 or 16, navigation works fine.
Same here! That's so annoying!