Skip to content

Instantly share code, notes, and snippets.

@mitnick78
Created February 21, 2022 18:25
Show Gist options
  • Save mitnick78/57319636d0dc5ad00f2b8c79a71b6469 to your computer and use it in GitHub Desktop.
Save mitnick78/57319636d0dc5ad00f2b8c79a71b6469 to your computer and use it in GitHub Desktop.
struct TchatAppApp: App {
@Environment(\.scenePhase) var scenePhase
var body: some Scene {
WindowGroup {
ContentView(authVM: AuthViewModel())
.onChange(of: scenePhase) { scenePhase in
if scenePhase == .background {
print("background")
// mettre l'user offline
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment