Issues building HikeView.swift (from SwiftUI Tutorial)

Currently working through the SwiftUI IOS tutorial, "Animating Views and Transitions" section. The instructions say to import the pre-made files downloaded from the tutorial (which I did) but it won't let me preview "HikeView.swift" like the tutorial suggests I should.

I haven't changed anything in the files and have followed the instructions to the tee, but getting "Compiling failed: cannot find type 'HikeView_Previews' in scope" error in HikeView.swift (and all the imported hike files).

Any help is appreciated!

Perhaps there is a problem with your Hike.swift?
Could you share the code for that?

Or maybe...
When you were adding the files to your project, did you check:

  • Copy items if needed
  • Add to targets {Landmarks}

Test:

  • Select the file "HikeView.swift"
  • In the file Inspector...
  • ...make sure "Target Membership" shows a tick by "Landmarks"

Issues building HikeView.swift (from SwiftUI Tutorial)
 
 
Q