10

I can't find solution to implement kind of ProgressBar in Widget. I see, that Text component should be changed if has type .timer for example. I see default widget Clock, with nice animation of moving arrow. But am I able to implement custom animation in widget?

pawello2222
  • 46,897
  • 22
  • 145
  • 209
Konstantin.Efimenko
  • 1,242
  • 1
  • 14
  • 38
  • 3
    From what I heard custom animations are not allowed in widget (probably for optimization reasons). – rraphael Oct 23 '20 at 14:24
  • I can't find reference on it, but also I see animation on default Clock widget. – Konstantin.Efimenko Oct 23 '20 at 14:30
  • 3
    I didn't find any official reference too, but I couldn't manage to get an animation working inside a widget. For the default Clock widget, Apple might be using a private API or something to achieve that (this wouldn't be the first time). – rraphael Oct 23 '20 at 14:41
  • 1
    @rraphael. I think you’re right. It is probably an Apple only feature. Like the clock icon animating or the calendar icon updating daily, features that only Apple can use. – Andrew Oct 23 '20 at 15:29
  • 1
    there are third party Apps, with hand clock animations, not sure how they are doing it. – Martin Romañuk Feb 23 '21 at 14:28

1 Answers1

5

According to a Frameworks Engineer on Developer Apple Forum:

Animations and pan/zoom gesture do not work in widgets built with WidgetKits. Checkout https://developer.apple.com/videos/play/wwdc2020/10028/, where what works and doesn't.

Throughout the WWDC20 Meet WidgetKit video mentioned above, Apple stresses that Widgets are not mini-apps, so they don't support gesture based views (like scroll views) or animations. Widgets are meant to only have glanceable information. From WWDC20 Meet WidgetKit Video Transcript:

These widgets are not mini-apps. We do not support scrolling within the widget, interactive elements like switches and other system controls, nor videos or animated images.

rohanphadte
  • 978
  • 6
  • 19