Integrating Firebase Authentication into iOS 14/Xcode 12 with SwiftUI

Firebase Authentication with SwiftUI

Introduction

Getting Started

import SwiftUI
@mainstruct YourProject: App { var body: some Scene { WindowGroup { ContentView() } }}struct YourProjectApp_Previews: PreviewProvider { static var previews: some View { Text("Hello, World!") }}
  1. Import Firebase and UIKit into YourProjectApp.swift
import Firebase
import UIKit // We will need UIKit to implement AppDelegate
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// Configure FirebaseApp
FirebaseApp.configure()
return true
}
}
@mainstruct BizeeiOS: App {    // Create a reference to the App Delegate     @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate     var body: some Scene {          WindowGroup {               ContentView()          }     }}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store