In the code below you can see the error and the code used in my xxApp.swift folder. I was creating Sign In and a Sign Up function, and everything worked very well, but then I got this error when clicking on the register button. If you need more code just let me know, thanks in advance! Here is the code of the @main :
import Firebase
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()
return true
}
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()
return true
}`final class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()
return true
}
}
@main //"Thread 1: EXC_BAD_ACCESS (code=2, address=0x7ffee1a57ff0)"
struct PSMAApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
@StateObject var sessionService = SessionServiceImpl()
var body: some Scene {
WindowGroup {
NavigationView{
switch sessionService.state {
case .loggedIn:
HomeView()
.environmentObject(sessionService)
case .loggedOut:
LoginView()
}
}
}
}
}