import WidgetKit /// The app's side of the widget (#428): changes what it shows, and asks WidgetKit to draw it again /// when something it shows has changed. Not for each position saved, every ten seconds: iOS gives /// an app a few dozen redraws a day, so the place moves on at the next play, pause or count. @MainActor enum WidgetFeed { static func update(reload: Bool = true, _ change: (inout Snapshot) -> Void) { var s = Snapshot.load() let was = s change(&s) guard s != was else { return } s.save() if reload { WidgetCenter.shared.reloadAllTimelines() } } }