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