You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
953 B
40 lines
953 B
//
|
|
// AllInApp.swift
|
|
// AllIn
|
|
//
|
|
// Created by Emre on 19/09/2023.
|
|
//
|
|
|
|
import SwiftUI
|
|
import DependencyInjection
|
|
import Model
|
|
|
|
@main
|
|
struct AllInApp: App {
|
|
|
|
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
|
@Environment(\.scenePhase) var phase
|
|
let DI = DependencyInjection.shared
|
|
|
|
init() {
|
|
DI.addSingleton(IAuthService.self, AuthService())
|
|
}
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
ContentView()
|
|
.onAppear {
|
|
AppStateContainer.shared.notificationState.scheduleNotifications()
|
|
}
|
|
.onChange(of: phase) { newPhase in
|
|
switch newPhase {
|
|
case .background, .inactive:
|
|
UIApplication.shared.shortcutItems = QuickAction.allShortcutItems
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|