Navigation View

How can I add navigation to an existing program. I coded this as per youtube video: var body: some View { NavigationView { VStack { NavigationLink(destination: viewdetail()) { Text("click") .frame(width: 300, height: 150, alignment: .center) .background(Color.gray) .foregroundColor(.black) } } } It doesn't work. If I comment out the rest of the program it works. I have VStacks and HStacks and functions after the navigation code. Please help.

Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Albert Pascual
  Worldwide Developer Relations.

Thank you

Navigation View
 
 
Q