I am trying to play around with swiftUI in Xcode 11 and macOS Catalina. BUT After creating a new Project, there is a boiler plate code with a Text that says hello World. I want to have a live preview of this simple welcome message in the canvas by the side of the code.
When i hit the resume button : It says :
Cannot Preview in this file - Failed to launch [App Name]
I've tried hitting the diagnostic button that generated a report to send it to APPLE saying:
[FailedToLaunchError(url: file:///Users/naive/Library/Developer/Xcode/DerivedData/first_swiftUI-dymizjogcbtouhclgjhhefagmcqo/Build/Intermediates.noindex/Previews/first_swiftUI/Products/Debug-iphoneos/first_swiftUI.app, underlying: Error Domain=NSOSStatusErrorDomain Code=-10661 "(null)" UserInfo={_LSLine=3554, _LSFunction=_LSOpenStuffCallLocal}, failureCategory: UVFoundation.FailureCategory.infrastructureFailure) ]
Here's the code, It is the default code that comes with new project created with Xcode 11 and SwiftUI option checked:
import SwiftUI
struct ContentView : View {
var body: some View {
Text("Hello World")
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
}
#endif
I expect the canvas to show up and display live preview of my code. The canvas is not showing up !!
There are two warning messages generated :
:0: warning: imported declaration 'UITableViewDiffableDataSourceCellProvider' could not be mapped to 'UITableViewDiffableDataSourceReference.CellProvider'
:0: warning: imported declaration 'UICollectionViewDiffableDataSourceCellProvider' could not be mapped to 'UICollectionViewDiffableDataSourceReference.CellProvider'
other than that, My iPad 11"with iPadOS beta runs the app, The simulator is working as well