Widget Timelines With Clock-Based App

Apple Recommended

Replies

I would like to add that I am aware of the SwiftUI Timer Text which would allow the widget to continue displaying time information continuously. However, this would still not solve the ability for the circle timer to animate continuously or even on a minute basis.
I've been following this thread and reading through the docs and I'm pretty stuck on something. I'm able to show the difference between 2 times. I'm able to set a countdown timer. But I'm having issues with 2 things.
  1. How would I show the current time on a widget (and keep it up to date)

  2. Do a count up timer

Thanks!
With the current APIs you couldn't show the current time, unfortunately.

I'm not completely sure what you mean by a "count up timer", but if you use the Text APIs with a .offset style and specify a date that's in the past, that will count up from that date.

For any formatting that you want to do but cannot with the current APIs, please file Feedback Assistant requests, with details of what you're looking to do.
Ah bummer... So I've tried out the .offset style, but it automatically formats it as "+5 minutes" or "-30 seconds". Is there any way to remove the access information to just show the number?
In beta 1 it seemed like widgets refreshed from the timeline every few seconds. Since beta 2 it seems to be much less frequent, like maybe once an hour. I am fine with not updating every second, but once a minute seems quite reasonable given the low cost of the widget views.

I think this will be a problem for apps which want to show timely glanceable information (for example the system clocks widget does not update every minute). I will raise a feedback.
That’s awesome! Thank you for the support. The current API’s already allow for countdown timers by second, so this doesn’t seem too, too unreasonable to me.
Any new information here? I am seeing lots of widget apps display current time. Wondering what I am missing here.
It seems that the DClock app can somehow update the analog clock every second. Their watch has a second hand that updates every second. Any ideas how we can do the same?
For the DClock in the AppStore, I suspect that the app has used private API (same as the clock.app by Apple) to animate the second hand smoothly. I am not here to disclose the API but a simple Google search will reveal.

It is quite obvious that it is true, since the animation is absolute in sync with Apple's own clock. Frequent calls to WidgetCenter.shared.reloadAllTimelines() can never achieve this.

Just two requests to Apple's Widget team:
1) May Apple please take action and remove any app if private API is used. It is unfair that some developers are gaining advantage.
2) May Apple please release this API as public. A clock widget with hands animation makes sense.



Widgetsmith is able to show a fuzzy clock (“twenty past four”) with very accurate time. I thought it was possible to have an update every few minutes. I wanted to implement one in a non-English but could not get that kind of update. I wonder what they are doing there.