NavigationLink appears as unresolved, has it been deprecated?

Going through some learning materials on SwiftUI, I'm trying to wrap a view inside a NavigationLink but it appears unresolved.


struct LandmarkList: View {
    var body: some View {
        NavigationView {
            List(landmarkData) { landmark in
                NavigationLink(destination: LandmarkDetail()) {
                    LandmarkRow(landmark: landmark)
                }
            }.navigationBarTitle(Text("Landmarks"))
        }
    }
}


This is the error I get:

Use of unresolved identifier 'NavigationLink'; did you mean 'NavigationView'?

Replies

Which version of XCode ?

I do not see any deprecation information.


Seems you followed exactly this tutorial

h ttps://developer.apple.com/tutorials/swiftui/building-lists-and-navigation


Did you check your import ?

I can't get past the same. Got XCode 11.0 beta 2. According to doc NavigationLink is a part of SwiftUI, no additional imports needed 😟

Similar issue in XCode 11.1


It throws "Use of unresolved identifier 'LandmarkDetail'".