How to animate WidgetKit Widgets like other apps do it? - ios

While Apple stated that animations should not be possible in Widgets, some apps managed to implement them. Example: https://apps.apple.com/app/id1588400483
These don’t only animate every second statically, but seemingly with 60/120 fps. How to achieve this?
I have been trying with the stock animation (which the documentation states don’t work) and by using timers. Both with no success at all.

Related

How to get animation info in After Effects for developers? not Lottie

I am developing an app using flutter. My UI design uses After Effects to do a nice set of interactive animations that include elements in the page, obviously I can't do it with Lottie. But currently searching for After Effects export animation information only gives me Lottie related information.I already know how to implement animation with flutter, but I don't know detailed animation information.
Is there any other way to get animation information from After Effects, including duration, animation curve, etc.
I have found an AE plugin that can export animation parameters。

UICollectionViewCell Momentum Animation?

I'm working on a project that has some pretty specific design guidelines. I've been playing around with animations for a while now but I have not come up with exactly what is needed.
I'm trying to mimic the effect of the iOS Messenger app, where when scrolling messages they appear to have some 'momentum' to them. How is this effect accomplished? Also what is it called? I haven't found any info on it so far.
I am trying to implement this effect in Swift.

WKInterfaceSlider behavior like in Watch’s Now Playing

How can I implement same border appearing behavior over a slider (or group) when user changes volume value by digital crown? I have insert a video which demonstrate this.
I have implemented this by using ValueAnimation from this question. Instead of using NSTimer I use GCD-based timer to have more flexibility. See RXTimer or DispatchTimer for more info.

local animations in Objective-C

I've been looking through a few applications for inspiration and see many image based animations, for logos or text etc. However, some of these animations don't appear to be possible in objective-c or at least from my knowledge. So I've been looking to get my own created. However, I've read that you cannot run .swf in objective-c. So, what are my options for animation files that I can run? If I go to a freelancer and request an animation. What type of animation do I need to be asking for?
This could be for a simple logo animation on the application launch, or could be for an event in the game. I.e, a cutscene.
Question
What animation files would best suit my needs and/or is it possible to run it locally? I don't want to be including html. A simple file, launched create the animation. Like a .gif.

Detect UI changes

I have a function that continuously takes screenshots of an UI element to then draw it itself. The UI element can change, so I take a screenshot in very short intervals to not have the second drawing lag behind (please don't question this and just assume that redrawing it is the right way. The use case is a bit more complicated).
However, taking the screenshot and invalidating the previous drawing to redraw it is quite an expensive operation, and most often not needed as the UI element doesn't update that often. Is there a way to detect when a UI element changes in such a way that it needs redrawing, including when it happens to one of its subviews? One solution would be to copy the state and the states of all its descendents and then check that, but that doesn't seem like a good solution either. iOS must know internally when it needs to redraw/update the views, is there any way to hook into this? Note that I tagged this UIKit and Core-Animation, I suppose the way to go for this is Core-Animation, but I'm open for a solution that uses either of these.

Resources