I'm following the https://developer.apple.com/tutorials/swiftui/tutorials for SwiftUI and I've downloaded both macOS Catalina and Xcode 11.0 beta.
Canvas crashed and doesn't restore even after trying the following:
- I've tried completely cleaning the project - failed
- I've tried restarting Xcode - failed
- I've tried rebooting - failed
The code simply declares the UI, nothing too fancy.
import SwiftUI
struct LandmarkDetail : View {
var landmark: Landmark
var body: some View {
VStack {
MapView(coordinate: landmark.locationCoordinate)
.edgesIgnoringSafeArea(.top)
.frame(height: 300)
CircleImage(image: landmark.image(forSize: 250))
.offset(y: -130.0)
.padding(.bottom, -130.0)
VStack(alignment: .leading) {
Text(landmark.name)
.font(.title)
.multilineTextAlignment(.center)
HStack {
Text(landmark.park)
.font(.subheadline)
Spacer()
Text(landmark.state)
.font(.subheadline)
}
}
.padding()
Spacer()
}
.navigationBarTitle(Text(landmark.name), displayMode: .inline)
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
LandmarkDetail(landmark: landmarkData[0])
}
}
#endif
I expect the canvas to show the UI, but I keep getting the Cannot preview in this file --- MyApp.app may have crashed error.
Here is an image of what that looks like:
Please note that everything was working fine until a certain point.
Thanks in advance for your help!

