Building Lists and Navigation tutorial

I have been working throught the SwiftUI demo code tasks from this website and now I am at the point "Create the Row View".


When I create the LandmarRow.swift file, an error appears immediately


Error: Failed to build LandmarkRow.swift


Compiling failed: no type named 'LandmarkRow_Previews' in module 'Landmarks'

Which version of MacOS ?

Which version of XCode ?

Catalina


Xcode 11.1

Could you show your


LandmarkRow.swift


have you defined there:


struct LandmarkRow: View { var landmark: Landmark
     var body: some View { HStack {
          landmark.image(forSize: 50)
          Text(landmark.name) }
     } }

struct LandmarkRow_Previews: PreviewProvider { static var previews: some View {
     LandmarkRow(landmark: landmarkData[1]) }
}



I have the same problem and can not continue with the tutorial.

I have not changed the code. The error appears straight after creating the new file... And that error just appears in this tutorial.

If i create my own Xcode project and create new .swift files there is not a problem.


Same problem.

It is now April 2020 and I too have run into this problem. The examples in the Building Lists and Navigation tutorial do not match the BuildingListsAndNavigation project files downloaded from the tutorial.


In the example in Section 2, Step 1 of the tutorial, the LandmarkRows.swift file is shown as being saved into "Landmarks Views" folder. That folder does not exist in the downloaded resource files. So where do I save it?


Also at the beginning of Section 1, Step 1 it mentions nothing about loading the BuildingListsAndNavigation -> StartingPoint -> Landmarks -> BuildingListsAndNavigation.xcodeproj so I am assuming that is what was needed in order to start with Step 1.


And finally, to complicate matters even worse, there isn't even a folder named "Landmark Views" anywhere in BuildingListsAndNavigation -> Complete -> Landmarks -> Landmarks. It is named "Supporting Views" which isn't shown anywhere in this tutorial.


It's like independent developers wrote the tutorial, others wrote the code, and no one verified the tutorial matches the example code and folder structure.

I was trying to open the xcodeproj file from the downloads folder. After moving the downloaded folder to the SwiftUI - Learning Test App folder where the Landmarks and Learning Test App folders were located from the first tutorial it opens and builds correctly. However, the folder structure does not match what is in the tutorial.


This needs to be explained more clearly for us newbies who are trying to learn XCode and SwiftUI for the first time.

***** it! I have tried everything I can think of to get this tutorial to work and it is so **** buggy, I will just have to go somewhere else to learn how to develop using Apple's development environment. It's a shame because they charge so much money for their products and yet they can't even make a simple tutorial that works...

Apple Feedback has corrected this issue after I reported it. The tutorial is now correct.

Thanks for this honest feedback.


Just shows they take care of their software.


Wish a good day.

same error till now.
---------------------------
use of unresolved identifier 'landmarkData
CompileDylibError: Failed to build LandmarkRow.swift
Compiling failed: use of unresolved identifier 'landmarkData'
Building Lists and Navigation tutorial
 
 
Q