Skip to content

v1.3.3 - Progress/Frame observers for macOS

Latest
Compare
Choose a tag to compare
@tfmart tfmart released this 17 Feb 00:02
· 1 commit to main since this release

This new release finally enables to observe the progress or frame of a Lottie animation in real time for macOS apps! In order to do so, you can use the same .onFrame(_:) or .onProgress(_:) modifiers from the iOS counterpart.

However there's a caveat...

With the introduction of Lottie 4.0, the animation observers of LottieUI stopped working properly when rendering an animation with the new CoreAnimation setting, both for iOS and macOS. If you need to make use of the .onFrame(_:) or .onProgress(_:) modifiers, make sure that you're using the Main Thread rendering engine for now. You can set it by using the .renderingEngine(_:) method:

LottieView("my-animation")
    .renderingEngine(.mainThread) // setup the mainThread engine before observing progress/framerate
    .onFrame { _ in
        // ...
    }

Gravação de Tela 2023-02-16 às 20 59 24

I've created an issue #10 to keep track of any progress on getting the animation observer working on the new rendering engine.