airbnb / lottie-ios

An iOS library to natively render After Effects vector animations
http://airbnb.io/lottie/
Apache License 2.0
25.77k stars 3.75k forks source link

ios16.x Device 14pro LAContext auth animation slow dynamic Island (function) #1812

Closed JinhongPark closed 1 year ago

JinhongPark commented 1 year ago

The rendering engine function is also enabled.

Animation runs extremely slowly on devices with iPhone 14pro dynamic islands (features).

    LottieConfiguration.shared.renderingEngine = .automatic //slowly
    //.coreAnimation slowly
    //.mainThread slowly

    self.containerView.frame = UIScreen.main.bounds
    self.containerView.backgroundColor = UIColor.clear
    self.containerView.isAccessibilityElement = true
    self.containerView.accessibilityTraits = UIAccessibilityTraits.image

lazy var lottieView: LottieAnimationView = {
                var animation = LottieAnimation.named("JBBANK_loading")
            self.lottieView = LottieAnimationView(animation: animation)
            self.lottieView.frame = CGRect(x:0, y:0, width:60, height:60)
            self.lottieView.center = self.containerView.center
            self.lottieView.contentMode = .scaleAspectFill
            self.lottieView.animationSpeed = 1.5
            self.lottieView.backgroundBehavior = .pauseAndRestore
            self.lottieView.loopMode = .autoReverse

    return self.lottieView
}()

func showIndicator(){
    DispatchQueue.main.async {

         UIApplication.shared.keyWindow?.addSubview(self.containerView)
                self.containerView.addSubview(self.lottieView)
        self.lottieView.play()

    }
}

func hideIndicator(){
    DispatchQueue.main.async {

            self.lottieView.stop()
            self.containerView.removeFromSuperview()
            self.lottieView.removeFromSuperview()
        }
}

}

calda commented 1 year ago

Can you share a copy of the animation json, a video recording / gif of your issue, and ideally also include a sample project that reproduces the issue?

JinhongPark commented 1 year ago

Can you share a copy of the animation json, a video recording / gif of your issue, and ideally also include a sample project that reproduces the issue?

Thank you for your confirmation. I attached the video. I will make the sample source and upload it soon. We found the exact phenomenon. What's happening now is that the LAContext feature is 14proMax As the dynamic island (function) runs, lottie animation slows down.

However, if you turn on the recording function and run LAContext, the lotite animation is natural without interruption.

So when I watch the video I recorded, the lottie animation doesn't look broken.

https://user-images.githubusercontent.com/16997600/202056193-ae34d04d-46db-4ad5-801d-2f7193e74803.mp4

JinhongPark commented 1 year ago

Our app has many solutions (components) that are securely linked to financial apps.

I downloaded the reference github and made a lotie sample source.

We're checking if there's a problem on our side, too.

However, it does not occur on the basic dynamic island (function) iPhone 14pro.

However, please review if there is any abnormality in your lotie above dynamic island (function) iphone 14pro.

(SampleDynamicIsland)Secret-Swift-master.zip

(LAContext) reference : https://github.com/eryshkov/Secret-Swift

JinhongPark commented 1 year ago

I found the right answer to the issue. It was a bug in iOS16.0.

16.1.1 No bugs occur after updating baseline 11-23. If you have a problem like me, please refer to it