アプリを再度開いたときにする処理を書きたい
swift
@Environment(\.scenePhase) var scenePhase
...
.onChange(of: scenePhase) { _, newPhase in
if newPhase == .active {
print("Active")
} else if newPhase == .inactive {
print("Inactive")
} else if newPhase == .background {
print("Background")
}
}