-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGVCoursesApp.swift
48 lines (43 loc) · 1.35 KB
/
GVCoursesApp.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// GVCoursesApp.swift
// GVCourses
//
// Created by Minh Tran on 01/10/2023.
//
import SwiftUI
import FirebaseCore
import GoogleSignIn
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()
return true
}
@available(iOS 9.0, *)
func application(_ application: UIApplication, open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any])
-> Bool {
return GIDSignIn.sharedInstance.handle(url)
}
}
@main
struct GVCoursesApp: App {
@AppStorage("signIn") var isSignIn = false
@State private var showSignUpView = false
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
var body: some Scene {
WindowGroup {
if !isSignIn {
if !showSignUpView {
SignInView(showSignUpView: $showSignUpView).withErrorHandling()
} else {
SignUpView(isPresented: $showSignUpView).withErrorHandling()
}
} else {
GVCoursesTabView()
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
}
}
}
}