You can not use NavigateLink in ContextMenu, maybe you can use .sheets
something like this:
struct ContentView: View {
@State var issheetshown = false
var body: some View{
NavigationStack{
VStack {
Text("Click To Add Text")
.padding(EdgeInsets(top: 10, leading: 140, bottom: 0, trailing: 0))
.frame(maxWidth: .infinity, alignment: .leading)
.contextMenu {
Button {
print("Type down")
issheetshown = true
} label: {
HStack {
Text("Type Down")
Spacer()
Image(systemName:
"scribble.variable")
}
}
}
.sheet(isPresented: $issheetshown) {
NotesView()
}
For NotesView, it is just a average SwiftUI view, so you can just put anything that you like :). And you can alter the text and buttons however you like, Hope this will work!
-Ted :D