I want help in giving a refreshing policy that refreshes once a day.
Hi,
To do this, you may pass a TimelineReloadPolicy which explicitly asks to be updated tomorrow. Such as
A similar example is described in TimelineProvider's documentation.
To do this, you may pass a TimelineReloadPolicy which explicitly asks to be updated tomorrow. Such as
Code Block swift /* Return timelines and set policy to reload tomorrow */ func timeline(with context: Context, completion: @escaping (Timeline<MyEntryType>) -> ()) { ... let tomorrow = Calendar.current.date(byAdding: .day, value: 1, to: Date())! let timeline = Timeline<MyEntryType>(entries: entries, policy: .after(tomorrow)) ... }
A similar example is described in TimelineProvider's documentation.