Meshtastic-Apple/MeshtasticClient/MeshtasticClientApp.swift
2021-11-29 19:58:06 -08:00

31 lines
723 B
Swift

import SwiftUI
import CoreData
@main
struct MeshtasticClientApp: App {
@ObservedObject private var bleManager: BLEManager = BLEManager()
@ObservedObject private var userSettings: UserSettings = UserSettings()
@Environment(\.scenePhase) var scenePhase
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(userSettings)
.environmentObject(bleManager)
}
.onChange(of: scenePhase) { (newScenePhase) in
switch newScenePhase {
case .background:
print("Scene is in the background")
case .inactive:
print("Scene is inactive")
case .active:
print("Scene is active")
@unknown default:
print("Apple must have changed something")
}
}
}
}