Updating from Navigation view to NavigationStack

I'm currently using a navigationview and am now getting an warning

'init(destination:tag:selection🏷️ )' was deprecated in iOS 16.0: use NavigationLink(value🏷️ ) inside a List within a NavigationStack or NavigationSplitView

I'm trying to move to another view from a button (there will be several hence using tags) but I can't seem to get my head around how to do it.

The code I currently have

    var body: some View {
        List {
            NavigationLink(destination: ProjectColourAddView(project: project), tag: 1, selection: $action) {
                EmptyView()
            }

            Group {
                Button(action: { self.showImageMenu = true }) {
                    Text("New Title Image")
                }
                .confirmationDialog("Select Image Source", isPresented: $showImageMenu, titleVisibility: .visible) {
                    Button("Take Photo") {
                        self.isShowCamera = true
                    }
                    Button("Choose from Albums") {
                        self.isShowPhotoLibrary = true
                    }
                }
                
                Button(action: {
                    self.action = 3
                    NSLog("More Images")
                }) {
                    Text("More Images (x)")
                }
                
                Button(action: {
                    self.action = 2
                    NSLog("Add Image")
                }) {
                    Text("Add Image")
                }
                
                Button(action: {
                    self.action = 1
                    NSLog("Colour List")
                }) {
                    Text("Colour List")
                }
            }
        }
    }

Did you try adding NavigationStack:

    var body: some View {

        NavigationStack {   // <<-- Here
            List() {
                NavigationLink(…) {
                    EmptyView()
                }

See details here: https://developer.apple.com/documentation/swiftui/migrating-to-new-navigation-types

Take care that works only for iOS 16 targets or higher, so it may require conditional compilation with if #available(iOS 16.0, *) { // NavigationStack } else { // NavigationView } However, for the time being, you can simply ignore the warning and continue with NavigationView

My previous view has the navigation stack in it

Updating from Navigation view to NavigationStack
 
 
Q