import SwiftUI
import RealmSwift
@main
struct RealmUpdatedDemoApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
On importing RealmSwift on the main App file, I am getting this error but not on other files.
CodePudding user response:
Its a case of name collision, explicitly specify the namespace SwiftUI
for App
, if you want to import RealmSwift
in this class:
Example:
import SwiftUI
import RealmSwift
@main
struct SwiftUITestApp: SwiftUI.App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}