From eb502667452a48b6a7bc53bcf705f8bb28523a5d Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 3 Jan 2023 21:31:04 -0700 Subject: [PATCH] Fix Firebase initialization --- Twigs/TwigsApp.swift | 5 +++++ Twigs/Views/MainView.swift | 10 ---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Twigs/TwigsApp.swift b/Twigs/TwigsApp.swift index 2e8662a..3ea7dfd 100644 --- a/Twigs/TwigsApp.swift +++ b/Twigs/TwigsApp.swift @@ -6,6 +6,7 @@ // Copyright © 2021 William Brawner. All rights reserved. // +import FirebaseCore import SwiftUI import TwigsCore @@ -18,4 +19,8 @@ struct TwigsApp: App { MainView(apiService as TwigsApiService) } } + + init() { + FirebaseApp.configure() + } } diff --git a/Twigs/Views/MainView.swift b/Twigs/Views/MainView.swift index 79a3641..321ab0e 100644 --- a/Twigs/Views/MainView.swift +++ b/Twigs/Views/MainView.swift @@ -6,20 +6,10 @@ // Copyright © 2021 William Brawner. All rights reserved. // -import FirebaseCore import SwiftUI import TwigsCore -class AppDelegate: NSObject, UIApplicationDelegate { - func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { - FirebaseApp.configure() - return true - } -} - struct MainView: View { - @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate @StateObject var dataStore: DataStore let apiService: TwigsApiService