airbnb / lottie-ios

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

How to correctly display. lottie format files in a project #2247

Closed RayFor24 closed 11 months ago

RayFor24 commented 11 months ago

The dotlottie file above is from my https://lottiefiles.com Downloaded from the website. d0b28ec1208af629c98c1ddf3

How should I present. lottie format files in a project

I cannot display when loading in the following way,Please give me an example, thank you

DotLottieFile.named("ip_coffee") { result in switch result { case .success(let dotLottieFile): self.animateView.loadAnimation(from: dotLottieFile) self.animateView.play() case .failure(let error): print(error) } }

Please give me an example, thank you

ip_coffee.lottie.zip

Which Version of Lottie are you using?

Lottie 4.3.3

Expected Behavior

Actual Behavior

Animation JSON

calda commented 11 months ago

As in https://github.com/airbnb/lottie-ios/issues/2243, this file is actually a JSON file with a ".lottie" file extension, not a "dotLottie" file. Just rename the file from ip_coffee.lottie to ip_coffee.json.