You could subcribe to UIApplicationSignificantTimeChangeNotification
struct ContentView: View {
var body: some View {
...
.onReceive(NotificationCenter.default
.publisher(for: UIApplication.significantTimeChangeNotification)) { (output) in
// Update variables at midnight here
}
}
}