SwiftuI view Error

Hi
Im copying the Apple tutorial project for lists and navigation for SWiftUI but Im getting an error although my code is same as Apple project, can some one check please.

Error
"Cannot find 'landmarks' in scope"

Kindest Regards



Code Block
import SwiftUI
struct LandmarkRow: View {
    var landmark: Landmark
    var body: some View {
        HStack {
            Text(landmark.name)
        }
    }
}
struct LandmarkRow_Previews: PreviewProvider {
    static var previews: some View {
        LandmarkRow(landmark: landmarks[0])
    }
}



Code Block
import Foundation
import SwiftUI
import CoreLocation
struct Landmark: Hashable, Codable {
    var id: Int
    var name: String
    var park: String
    var state: String
    var description: String
    
    private var imageName: String
    var image: Image {
        Image(imageName)
    }
    
    private var coordinates: Coordinates
    
    var locationCoordinate: CLLocationCoordinate2D {
        CLLocationCoordinate2D (
            latitude: coordinates.latitude,
            longitude: coordinates.longitude)
    }
    
    struct Coordinates: Hashable, Codable {
        var latitude: Double
        var longitude: Double
    }
    
}

Answered by Ammar S. Mitoori in 667565022
Got solved thank you
Accepted Answer
Got solved thank you
Hi,

I have the same issue now, what was your solution? Appreciate your help.
SwiftuI view Error
 
 
Q