lottie-ios icon indicating copy to clipboard operation
lottie-ios copied to clipboard

Support UIScene lifecycle events on iOS 13+

Open AEugene opened this issue 6 years ago • 1 comments

This issue is a:

  • [✓] Non-Crashing Bug (Visual or otherwise)

Description

iOS 13 introduced UIScene as the main tool to manage App's UI lifecycle. From the documentation:

A scene represents one instance of an app’s UI running on a device. The user can create multiple scenes for each app, and show and hide them separately. Because each scene has its own life cycle, each can be in a different state of execution. For example, one scene might be in the foreground while others are in the background or are suspended.

The application state is dependent on the states of all scenes and could be described in the following rule - Application becomes Active when one of the scenes moves to Foreground and resigns Active when all scenes move to Background.

Lottie depends on application state instead of UIScene state in the methods animationWillMoveToBackground, animationWillEnterForeground now. It results in a bug when there are two or more UIScene-s : when one of the scenes is open and the other one gets minimized and then opened again, the animation on the reopened scene is paused, because the state of the application does not change.

Which Version of Lottie are you using?

Lottie 3.0

What Platform are you on?

  • [✓] iOS

What Language are you in?

  • [✓] Objective-C

AEugene avatar Aug 16 '19 13:08 AEugene

Adding to feature requests. Will update this issue with progress

buba447 avatar Oct 10 '19 14:10 buba447