Skip to content

Instantly share code, notes, and snippets.

@1amageek
Created November 4, 2020 08:19
Show Gist options
  • Save 1amageek/4db68d235c86f7c4428464aac6dada4d to your computer and use it in GitHub Desktop.
Save 1amageek/4db68d235c86f7c4428464aac6dada4d to your computer and use it in GitHub Desktop.
Adding Firebase to AppDelegate in SwiftUI
import SwiftUI
import Firebase
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()
return true
}
}
@main
struct YourApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment