lottie-ios
Advanced tools
Comparing version 2.5.0 to 2.5.1
@@ -7,3 +7,3 @@ <!-- | ||
## Check these before submitting: | ||
- [] Updated to the latest version of Lottie (2.1.5) | ||
- [] Updated to the latest version of Lottie (2.5.0) | ||
- [] The issue doesn't involve an [Unsupported Feature](https://github.com/airbnb/lottie-ios/blob/master/README.md#currently-unsupported-after-effects-features) | ||
@@ -10,0 +10,0 @@ - [] This issue isn't related to another open issue |
{ | ||
"name": "lottie-ios", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with bodymovin and renders the vector animations natively on mobile and through React Native!", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -165,3 +165,3 @@ # Lottie for iOS, macOS (and [Android](https://github.com/airbnb/lottie-android) and [React Native](https://github.com/airbnb/lottie-react-native)) | ||
```swift | ||
let animationView = LOTAnimationView(name: "LottieLogo" bundle:yourBundle) | ||
let animationView = LOTAnimationView(name: "LottieLogo", bundle: yourBundle) | ||
self.view.addSubview(animationView) | ||
@@ -181,3 +181,3 @@ animationView.play() | ||
let translation = gesture.getTranslationInView(self.view) | ||
let progress = translation.y / self.view.bounds.size.height; | ||
let progress = translation.y / self.view.bounds.size.height | ||
animationView.animationProgress = progress | ||
@@ -225,3 +225,3 @@ ``` | ||
By setting `applyAnimationTransform` to YES you can make the Lottie animation move the from and to view controllers. They will be positioned at the origin of the layer. When set to NO Lottie just masks the view controller with the specified layer while resepecting z order. | ||
By setting `applyAnimationTransform` to YES you can make the Lottie animation move the from and to view controllers. They will be positioned at the origin of the layer. When set to NO Lottie just masks the view controller with the specified layer while respecting z order. | ||
@@ -239,3 +239,3 @@ ## Debugging | ||
LOTAnimationView provides `- (void)logHierarchyKeypaths` which will recursively log all settable keypaths for the animation. This is helpful for changing animationations at runtime. | ||
LOTAnimationView provides `- (void)logHierarchyKeypaths` which will recursively log all settable keypaths for the animation. This is helpful for changing animations at runtime. | ||
@@ -278,3 +278,3 @@ ## Adding Views to an Animation at Runtime | ||
// Setup our animaiton view | ||
// Setup our animation view | ||
animationView.contentMode = .scaleAspectFill | ||
@@ -285,3 +285,3 @@ animationView.frame = CGRect(x: 20, y: 20, width: 200, height: 200) | ||
// Lets change some of the properties of the animation | ||
// We arent going to use the MaskLayer, so lets just hide it | ||
// We aren't going to use the MaskLayer, so let's just hide it | ||
animationView.setValue(0, forKeypath: "MaskLayer.Ellipse 1.Transform.Opacity", atFrame: 0) | ||
@@ -384,10 +384,26 @@ // All of the strokes and fills are white, lets make them DarkGrey | ||
![Recolored Toggle](_Gifs/switch_BgColors.gif) | ||
**NB**: `animationView.setValue(YOUR_COLOR, forKeypath: "YOUR_PATH.Color", atFrame: 0)` is now deprecated. | ||
```swift | ||
animationView2.setValue(UIColor.green, forKeypath: "BG-On.Group 1.Fill 1.Color", atFrame: 0) | ||
animationView3.setValue(UIColor.red, forKeypath: "BG-On.Group 1.Fill 1.Color", atFrame: 0) | ||
animationView4.setValue(UIColor.orange, forKeypath: "BG-On.Group 1.Fill 1.Color", atFrame: 0) | ||
``` | ||
class GreenDelegate : NSObject, LOTColorValueDelegate { | ||
func color(forFrame currentFrame: CGFloat, startKeyframe: CGFloat, endKeyframe: CGFloat, interpolatedProgress: CGFloat, start startColor: CGColor!, end endColor: CGColor!, currentColor interpolatedColor: CGColor!) -> Unmanaged<CGColor>! { | ||
return Unmanaged.passRetained(UIColor.green.cgColor) | ||
} | ||
} | ||
animationView2.setValueDelegate(GreenDelegate(), for: LOTKeypath(string: "BG-On.Group 1.Fill 1.Color")) | ||
```objective-c | ||
[animationView2 setValue:[UIColor greenColor] forKeypath:@"BG-On.Group 1.Fill 1.Color" atFrame:@0]; | ||
class RedDelegate : NSObject, LOTColorValueDelegate { | ||
func color(forFrame currentFrame: CGFloat, startKeyframe: CGFloat, endKeyframe: CGFloat, interpolatedProgress: CGFloat, start startColor: CGColor!, end endColor: CGColor!, currentColor interpolatedColor: CGColor!) -> Unmanaged<CGColor>! { | ||
return Unmanaged.passRetained(UIColor.red.cgColor) | ||
} | ||
} | ||
animationView3.setValueDelegate(RedDelegate(), for: LOTKeypath(string: "BG-On.Group 1.Fill 1.Color")) | ||
class OrangeDelegate : NSObject, LOTColorValueDelegate { | ||
func color(forFrame currentFrame: CGFloat, startKeyframe: CGFloat, endKeyframe: CGFloat, interpolatedProgress: CGFloat, start startColor: CGColor!, end endColor: CGColor!, currentColor interpolatedColor: CGColor!) -> Unmanaged<CGColor>! { | ||
return Unmanaged.passRetained(UIColor.orange.cgColor) | ||
} | ||
} | ||
animationView4.setValueDelegate(OrangeDelegate(), for: LOTKeypath(string: "BG-On.Group 1.Fill 1.Color")) | ||
``` | ||
@@ -401,5 +417,5 @@ The keyPath is a dot separated path of layer and property names from After Effects. | ||
![Multiple Colors](_Gifs/switch_MultipleBgs.gif) | ||
```swift | ||
animationView2.setValue(UIColor.green, forKeypath: "BG-On.Group 1.Fill 1.Color", atFrame: 0) | ||
animationView2.setValue(UIColor.red, forKeypath: "BG-Off.Group 1.Fill 1.Color", atFrame: 0) | ||
animationView2.setValueDelegate(delegate, for: LOTKeypath(string: YOUR_PATH)) | ||
``` | ||
@@ -409,2 +425,9 @@ | ||
For this you need to use a `LOTValueDelegate` there are many already available: | ||
* `LOTColorValueDelegate` | ||
* `LOTNumberValueDelegate` | ||
* `LOTPointValueDelegate` | ||
* `LOTSizeValueDelegate` | ||
* `LOTPathValueDelegate` | ||
## Animated Controls and Switches | ||
@@ -417,3 +440,3 @@ | ||
You initialize the switch either using the conveneince method or by supplying the animation directly. | ||
You initialize the switch either using the convenience method or by supplying the animation directly. | ||
@@ -615,5 +638,5 @@ ``` | ||
## Issues or feature requests? | ||
File github issues for anything that is unexpectedly broken. If an After Effects file is not working, please attach it to your issue. Debugging without the original file is much more difficult. Lottie is developed and maintained by [Brandon Withrow](mailto:brandon.withrow@airbnb.com). Feel free to reach out via email or [Twitter](https://twitter.com/theWithra) | ||
File github issues for anything that is unexpectedly broken. If an After Effects file is not working, please attach it to your issue. Debugging without the original file is much more difficult. Lottie is developed and maintained by [Brandon Withrow](mailto:brandon@withrow.io). Feel free to reach out via email or [Twitter](https://twitter.com/theWithra) | ||
## Roadmap (In no particular order) | ||
- Add support for interactive animated transitions |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1573641
632
211