UNPKG

2.01 kBMarkdownView Raw
1# Migrating from Lottie 2.5.3(OBJC) -> 3.0 (SWIFT)
2
3Lottie 3.0 is a complete rewrite of Lottie in Swift. Because of this there are some minor API changes. This guide should help you through migrating code from Lottie 2.5.2 to 3.0
4
5For continued support and contribution to Objective-C please point to the official Lottie Objective-C Branch [Here](https://github.com/airbnb/lottie-ios/tree/lottie/objectiveC)
6
7Swift discourages the use of Prefix for names. A lot of the api changes are just the removal of `LOT` from the class name. Below is a complete list of API changes.
8
9To use Lottie Swift in an Objective-C project read Apple's official documentation [here](https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_swift_into_objective-c)
10
11## Class Changes
12| Lottie 2.5.2 | Lottie 3.0+ |
13| --:| --:|
14|`LOTAnimationView`|`AnimationView`|
15|`LOTComposition`|`Animation`|
16|`LOTKeypath`|`AnimationKeypath`|
17|`LOTAnimationCache`|`AnimationCacheProvider`|
18|`LOTCacheProvider`|`AnimationImageProvider`|
19|`LOTValueDelegate`|`AnyValueProvider`|
20|`LOTAnimatedControl`|`AnimatedControl`|
21|⛔️|`AnimatedButton`|
22|`LOTAnimatedSwitch`|`AnimatedSwitch`|
23
24## Method Changes
25
26| Lottie 2.5.2 | Lottie 3.0+ |
27| --:| --:|
28|`LOTAnimationView.sceneModel`|`AnimationView.animation`|
29|`LOTAnimationView.loopAnimation`|`AnimationView.loopMode`|
30|`LOTAnimationView.autoReverseAnimation`|`AnimationView.loopMode`|
31|`LOTAnimationView.animationProgress`|`AnimationView.currentProgress`|
32|`LOTAnimationView.cacheEnable`|⛔️(Cache is passed in on init)|
33|`LOTAnimationView.setValueDelegate:forKeypath:`|`AnimationView.setValueProvider:keypath:`|
34|`LOTComposition.animationNamed:`|`Animation.named:`|
35|`LOTComposition.animationWithFilePath:`|`Animation.filepath:`|
36|`LOTComposition.animationNamed:inBundle:`|`Animation.named:bundle:`|
37|`LOTComposition.animationFromJSON:`|⛔️(`Animation` is Encodable/Decodable from data on it's own.)|
38<!--stackedit_data:
39eyJoaXN0b3J5IjpbLTE1NDEwODc0Ml19
40-->