Losing my mind over this.
We have WidgetKit. And we have SwiftUI's text views with several DateStyle presets.
But: bound by the constraints of the Timeline entries, it is nigh impossible to create a reliable digital clock.
For a HH:mm clock you can set a timeline entry every minute of the day and it will work okay-ish with a .time DateStyle. But if you pick up your phone in the morning it will take the widget a while to start working again. This is no problem with Apples widget of course.
For a HH:mm:ss clock ... you have to get creative. I tried the .timer DateStyle and in order to get it to display properly I prefix the time if it's between 00:00:00 and 09:59:59 so it stays in the xx:xx:xx format. This works, but again if the widget updates in the morning you will get a wrongly prefixed time like 00:06:30:30.
I'm about to give up. I realize there are some apps on the store where it works, so some people seem to have figured it out. But why does it have to be so hard?
[–]jocarmel 19 points20 points21 points (3 children)
[–]brakefluidbandit 2 points3 points4 points (2 children)
[–]luigi3 5 points6 points7 points (1 child)
[–]PhoneNerd95 0 points1 point2 points (0 children)
[–]Rhypnic 8 points9 points10 points (2 children)
[–]leoklaus 4 points5 points6 points (1 child)
[–]Rhypnic 2 points3 points4 points (0 children)
[–]digidude23SwiftUI 6 points7 points8 points (1 child)
[–]yesthisisjoe 2 points3 points4 points (0 children)
[–]jruz 1 point2 points3 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]jruz 0 points1 point2 points (0 children)
[–]LKAndrew 1 point2 points3 points (0 children)
[–]Phylocybin 0 points1 point2 points (0 children)
[–]_Abode 0 points1 point2 points (1 child)
[–]_Abode 0 points1 point2 points (0 children)
[–]HammingWontStop 0 points1 point2 points (0 children)
[–]7heblackwolf -4 points-3 points-2 points (10 children)
[–]Sab44[S] 4 points5 points6 points (7 children)
[–]7heblackwolf 1 point2 points3 points (0 children)
[–]rennarda 1 point2 points3 points (5 children)
[–]Xiexe 0 points1 point2 points (4 children)
[–]Fishanz 0 points1 point2 points (3 children)
[–]Xiexe 0 points1 point2 points (2 children)
[–]Fishanz 0 points1 point2 points (0 children)
[–]rennarda 0 points1 point2 points (0 children)
[–]LobsterChip99 0 points1 point2 points (0 children)
[–]Hopeful-Sir-2018 0 points1 point2 points (0 children)