Post

Replies

Boosts

Views

Activity

Reply to Xcode 12 beta SwiftUI Canvas failing to show View
I ran into this on Xcode 12 Beta on Big Sur while following the SwiftUI tutorial: https://developer.apple.com/tutorials/swiftui/handling-user-input. The fix that worked was to add .environmentObject on the preview. Before: struct LandmarkDetail_Previews: PreviewProvider {   static var previews: some View {     LandmarkDetail(landmark: landmarkData[0])   } } After: struct LandmarkDetail_Previews: PreviewProvider {   static var previews: some View {     LandmarkDetail(landmark: landmarkData[0])       .environmentObject(UserData())   } }
Oct ’20