Composing Complex Interfaces tutorial projects view preview is broken

Working through the SwiftUI tutorial, I reached the "Composing Complex Interfaces" section and downloaded the project files.


On opening the "Starting Point" project, the first task is to create a new SwiftUI view named "Home.swift". If you activate the Preview for the unmodified new view, the Preview pane displays an error message whicj says that building "Home.swift" fails. Preview works for other views in the project, but not this one.


I tried opening the "completed" project, and the same problem occurs for "Home.swift" in that project.


I've tried cleaning the build, restarting Xcode, even restarting Catalina, and still can't get this to work.


Anyone seen something similar, or can you suggest a workaround?


TIA,

Doug K

Replies

Just remembered to try clearing ~/Library/Developer/Xcode/DerivedData. Seems to have cleared things up.

I looked in my developer folder and I don't see Xcode, only PrivateFrameworks.