Reputation: 9478
I have an existing UIKit application, using Storyboards. I want to add a new view using SwiftUI. My app is targeting iOS 13. The moment I add the SwiftUI view via File -> New -> File... -> Swift UI View
I get a compiler error on the line with the default label Text("Hello, World!")
. Do I need to update some configuration somewhere to enable Swift UI?
Upvotes: 0
Views: 235
Reputation: 119177
You probably have another type in your project named Text
. You can differentiate it from the Text
of SwiftUI by adding the module name before the type name:
var body: some View {
SwiftUI.Text("Hello World!")
}
Upvotes: 2