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")
}
}
}
}