Skip to content

Commit 213be50

Browse files
committed
First Release with 0.1.0 version
1 parent 8e80bbf commit 213be50

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ If you really want Lottie 3 support, please checkout [1.x branch](https://github
4949

5050
## Usage
5151

52+
### Load Lottie from remote JSON
53+
5254
+ Objective-C
5355

5456
```objective-c
@@ -65,6 +67,28 @@ let lottieJSONURL: URL
6567
animationView.sd_setImage(with: lottieJSONURL)
6668
```
6769

70+
### Advanced usage
71+
72+
This Lottie plugin use a wrapper class `LOTAnimatedImage` because of SDWebImage's [customization architecture design](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#customization). Typically you should not care about this, however this can allows some advanced usage.
73+
74+
+ Objective-C
75+
76+
```objective-c
77+
LOTComposition *composition = [LOTComposition animationFromJSON:jsonDict];
78+
LOTAnimatedImage *animatedImage = [[LOTAnimationImage alloc] initWithComposition:composition];
79+
// Snapshot Lottie animation frame
80+
UIImage *posterFrame = [animatedImage animatedImageAtIndex:0];
81+
```
82+
83+
+ Swift
84+
85+
```swift
86+
let composition = LOTComposition(json: jsonDict)
87+
let animatedImage = LOTAnimationImage(composition: composition)
88+
// Snapshot Lottie animation frame
89+
UIImage *posterFrame = animatedImage.animatedImageFrame(at: 0)
90+
```
91+
6892
## Demo
6993

7094
If you have some issue about usage, SDWebImageLottiePlugin provide a demo for iOS && macOS platform. To run the demo, clone the repo and run the following command.

SDWebImageLottiePlugin/Module/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
18+
<string>0.1</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
</dict>

0 commit comments

Comments
 (0)