Last active
May 26, 2023 11:17
-
-
Save filsv/6c5afc686f49ac7c2fcfa063fb1f2ac0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 'App' is ambiguous for type lookup in this context - Error and how to fix it: | |
import SwiftUI | |
import RealmSwift | |
// MARK: - Issue | |
@main | |
struct MyApp: App { // <- 'App' is ambiguous for type lookup in this context | |
init() { | |
// Configure Realm | |
} | |
var body: some Scene { | |
WindowGroup { | |
InitialView() | |
} | |
} | |
} | |
// MARK: - Fix | |
@main | |
struct MyApp: SwiftUI.App { // Simply add "SwiftUI." before App | |
init() { | |
// Configure Realm | |
} | |
var body: some Scene { | |
WindowGroup { | |
InitialView() | |
} | |
} | |
} | |
// Note: Realm using 'App' in its framework modules as well SwiftUI, so just needed to specify which one needed to import and issue will dissapear |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment