I am presenting a modal sheet from a navigation bar button in my code:
struct MainPage : View {
@State var isModalSheetShown: Bool = false
var body: some View {
VStack {
[...]
}
.navigationBarItems(trailing: HStack {
Button(action: { self.isModalSheetShown = true }) {
Text("Add")
}
})
.sheet(isPresented: $isModalSheetShown, content: {
VStack {
[...]
}
.navigationBarItems(trailing: HStack {
Button(action: { ... }) {
Text("Done")
})
})
})
}
}
But the Navigation Bar does not appear in the modal sheet as you can see below.
What am I doing wrong, how do you put a navigation bar on a modal sheet?