├── .gitignore
├── .swiftpm
└── xcode
│ └── package.xcworkspace
│ └── contents.xcworkspacedata
├── .travis.yml
├── Cartfile
├── Cartfile.resolved
├── Example
├── Podfile
├── SDWebImageLottiePlugin Example macOS
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── Contents.json
│ ├── Base.lproj
│ │ └── Main.storyboard
│ ├── Info.plist
│ ├── SDWebImageLottiePlugin_Example_macOS.entitlements
│ └── ViewController.swift
├── SDWebImageLottiePlugin.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── SDWebImageLottiePlugin-Example.xcscheme
│ │ ├── SDWebImageLottiePlugin_Example macOS.xcscheme
│ │ └── SDWebImageLottiePlugin_Tests.xcscheme
├── SDWebImageLottiePlugin.xcworkspace
│ └── contents.xcworkspacedata
├── SDWebImageLottiePlugin
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ └── ViewController.swift
├── Screenshot
│ ├── LottieDemo-macOS.gif
│ └── LottieDemo.gif
└── Tests
│ ├── Info.plist
│ ├── Tests.swift
│ ├── images
│ └── img_0.png
│ └── lotties
│ └── Assets.json
├── LICENSE
├── Package.resolved
├── Package.swift
├── README.md
├── SDWebImageLottiePlugin.podspec
├── SDWebImageLottiePlugin.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── xcshareddata
│ └── xcschemes
│ ├── SDWebImageLottiePlugin macOS.xcscheme
│ ├── SDWebImageLottiePlugin tvOS.xcscheme
│ └── SDWebImageLottiePlugin.xcscheme
└── SDWebImageLottiePlugin
├── Assets
└── .gitkeep
├── Classes
├── .gitkeep
├── AnimatedControl+WebCache.swift
├── AnimationView+WebCache.swift
├── LottieCompositionLayer.swift
└── LottieImage.swift
└── Module
└── Info.plist
/.gitignore:
--------------------------------------------------------------------------------
1 | # OS X
2 | .DS_Store
3 |
4 | # Xcode
5 | build/
6 | .build/
7 | *.pbxuser
8 | !default.pbxuser
9 | *.mode1v3
10 | !default.mode1v3
11 | *.mode2v3
12 | !default.mode2v3
13 | *.perspectivev3
14 | !default.perspectivev3
15 | xcuserdata/
16 | *.xccheckout
17 | profile
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 |
23 | # Bundler
24 | .bundle
25 |
26 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
27 | Carthage
28 |
29 | # We recommend against adding the Pods directory to your .gitignore. However
30 | # you should judge for yourself, the pros and cons are mentioned at:
31 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
32 | #
33 | # Note: if you ignore the Pods directory, make sure to uncomment
34 | # `pod install` in .travis.yml
35 | #
36 | Pods/
37 | Podfile.lock
38 |
--------------------------------------------------------------------------------
/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: objective-c
2 | osx_image: xcode11.2
3 |
4 | env:
5 | global:
6 | - LC_CTYPE=en_US.UTF-8
7 | - LANG=en_US.UTF-8
8 |
9 | addons:
10 | ssh_known_hosts: github.com
11 |
12 | notifications:
13 | email: false
14 |
15 | before_install:
16 | - env
17 | - locale
18 | - gem install cocoapods --no-document --quiet
19 | - gem install xcpretty --no-document --quiet
20 | - pod --version
21 | - pod repo update --silent
22 | - xcpretty --version
23 | - xcodebuild -version
24 | - xcodebuild -showsdks
25 |
26 | script:
27 | - set -o pipefail
28 |
29 | - echo Check if the library described by the podspec can be built
30 | - pod lib lint --allow-warnings
31 |
32 | - echo Build example
33 | - pod install --project-directory=Example
34 | - xcodebuild build -workspace Example/SDWebImageLottiePlugin.xcworkspace -scheme SDWebImageLottiePlugin-Example -sdk iphonesimulator -destination 'name=iPhone 11 Pro' | xcpretty -c
35 |
36 | - echo Clean DerivedData
37 | - rm -rf ~/Library/Developer/Xcode/DerivedData/
38 | - mkdir DerivedData
39 |
40 | - echo Run the tests
41 | - xcodebuild clean test -workspace Example/SDWebImageLottiePlugin.xcworkspace -scheme 'SDWebImageLottiePlugin_Tests' -destination 'platform=iOS Simulator,name=iPhone 11 Pro' -configuration Debug -UseModernBuildSystem=NO CODE_SIGNING_ALLOWED=NO | xcpretty -c
42 | - mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
43 |
44 | after_success:
45 | - bash <(curl -s https://codecov.io/bash) -D './DerivedData/iOS' -J '^SDWebImageLottiePlugin$' -F 'iOS'
--------------------------------------------------------------------------------
/Cartfile:
--------------------------------------------------------------------------------
1 | github "SDWebImage/SDWebImage" ~> 5.10
2 | github "airbnb/lottie-ios" ~> 3.4
3 |
--------------------------------------------------------------------------------
/Cartfile.resolved:
--------------------------------------------------------------------------------
1 | github "SDWebImage/SDWebImage" "5.13.0"
2 | github "airbnb/lottie-ios" "3.4.0"
3 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 |
3 | target 'SDWebImageLottiePlugin_Example' do
4 | platform :ios, '11.0'
5 | pod 'SDWebImageLottiePlugin', :path => '../'
6 |
7 | target 'SDWebImageLottiePlugin_Tests' do
8 | inherit! :search_paths
9 | pod 'SDWebImageLottiePlugin', :path => '../'
10 |
11 | end
12 | end
13 |
14 | target 'SDWebImageLottiePlugin_Example macOS' do
15 | platform :osx, '10.13'
16 | pod 'SDWebImageLottiePlugin', :path => '../'
17 | end
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin Example macOS/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) DreamPiggy
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | import Cocoa
10 | import Lottie
11 |
12 | @NSApplicationMain
13 | class AppDelegate: NSObject, NSApplicationDelegate {
14 |
15 |
16 |
17 | func applicationDidFinishLaunching(_ aNotification: Notification) {
18 | // Insert code here to initialize your application
19 | LottieConfiguration.shared.renderingEngine = .coreAnimation
20 | }
21 |
22 | func applicationWillTerminate(_ aNotification: Notification) {
23 | // Insert code here to tear down your application
24 | }
25 |
26 |
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin Example macOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin Example macOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin Example macOS/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin Example macOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | Copyright © 2020 CocoaPods. All rights reserved.
27 | NSMainStoryboardFile
28 | Main
29 | NSPrincipalClass
30 | NSApplication
31 | NSSupportsAutomaticTermination
32 |
33 | NSSupportsSuddenTermination
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin Example macOS/SDWebImageLottiePlugin_Example_macOS.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.files.user-selected.read-only
8 |
9 | com.apple.security.network.client
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin Example macOS/ViewController.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) DreamPiggy
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | import Cocoa
10 | import Lottie
11 | import SDWebImageLottiePlugin
12 | import SDWebImage
13 |
14 | class ViewController: NSViewController {
15 |
16 | let animationView = AnimationView()
17 |
18 | override func viewDidLoad() {
19 | super.viewDidLoad()
20 | animationView.contentMode = .scaleAspectFit
21 | animationView.frame = self.view.bounds
22 | animationView.autoresizingMask = [.width, .height]
23 | view.addSubview(animationView)
24 |
25 | let lottieUrl = URL(string: "https://raw.githubusercontent.com/airbnb/lottie-web/master/demo/adrock/data.json")
26 | animationView.sd_setImage(with: lottieUrl, completed: { _,_,_,_ in
27 | self.animationView.play(fromProgress: 0, toProgress: 1, loopMode: .repeat(5)) { finished in
28 | if finished {
29 | print("Animation Complete")
30 | } else {
31 | print("Animation cancelled")
32 | }
33 | }
34 | })
35 | }
36 |
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 216B8040AC5A1CEBB8A1AADD /* Pods_SDWebImageLottiePlugin_Example_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9122A01A53A3D3143D4B6F21 /* Pods_SDWebImageLottiePlugin_Example_macOS.framework */; };
11 | 320F7B26240D0C8900272A7A /* Assets.json in Resources */ = {isa = PBXBuildFile; fileRef = 320F7B25240D0C8900272A7A /* Assets.json */; };
12 | 320F7B28240D0D2100272A7A /* img_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 320F7B27240D0D2100272A7A /* img_0.png */; };
13 | 3249A542240A5ECB00AB1888 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3249A541240A5ECB00AB1888 /* AppDelegate.swift */; };
14 | 3249A544240A5ECB00AB1888 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3249A543240A5ECB00AB1888 /* ViewController.swift */; };
15 | 3249A546240A5ECE00AB1888 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3249A545240A5ECE00AB1888 /* Assets.xcassets */; };
16 | 3249A549240A5ECE00AB1888 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3249A547240A5ECE00AB1888 /* Main.storyboard */; };
17 | 5769D4B693D39F4B51D7E517 /* Pods_SDWebImageLottiePlugin_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E32CA5B95EB732D4745F2D2E /* Pods_SDWebImageLottiePlugin_Example.framework */; };
18 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
19 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
20 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
21 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
22 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
23 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
24 | B0EA0AD78069CE0A18453D4A /* Pods_SDWebImageLottiePlugin_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81030B8908307D3E713DC8A7 /* Pods_SDWebImageLottiePlugin_Tests.framework */; };
25 | /* End PBXBuildFile section */
26 |
27 | /* Begin PBXContainerItemProxy section */
28 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = {
29 | isa = PBXContainerItemProxy;
30 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
31 | proxyType = 1;
32 | remoteGlobalIDString = 607FACCF1AFB9204008FA782;
33 | remoteInfo = SDWebImageLottiePlugin;
34 | };
35 | /* End PBXContainerItemProxy section */
36 |
37 | /* Begin PBXFileReference section */
38 | 20A0C01111066EB216549706 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; };
39 | 2D65A2027DF1B719B440F0EA /* Pods-SDWebImageLottiePlugin_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImageLottiePlugin_Example.release.xcconfig"; path = "Target Support Files/Pods-SDWebImageLottiePlugin_Example/Pods-SDWebImageLottiePlugin_Example.release.xcconfig"; sourceTree = ""; };
40 | 320F7B25240D0C8900272A7A /* Assets.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Assets.json; sourceTree = ""; };
41 | 320F7B27240D0D2100272A7A /* img_0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = img_0.png; sourceTree = ""; };
42 | 3249A53F240A5ECB00AB1888 /* SDWebImageLottiePlugin_Example macOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SDWebImageLottiePlugin_Example macOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 3249A541240A5ECB00AB1888 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
44 | 3249A543240A5ECB00AB1888 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
45 | 3249A545240A5ECE00AB1888 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
46 | 3249A548240A5ECE00AB1888 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
47 | 3249A54A240A5ECE00AB1888 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
48 | 3249A54B240A5ECE00AB1888 /* SDWebImageLottiePlugin_Example_macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SDWebImageLottiePlugin_Example_macOS.entitlements; sourceTree = ""; };
49 | 338A760EC5B8FA4940015305 /* Pods-SDWebImageLottiePlugin_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImageLottiePlugin_Example.debug.xcconfig"; path = "Target Support Files/Pods-SDWebImageLottiePlugin_Example/Pods-SDWebImageLottiePlugin_Example.debug.xcconfig"; sourceTree = ""; };
50 | 4BC8F6E12F77DA65CA981B61 /* Pods-SDWebImageLottiePlugin_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImageLottiePlugin_Tests.release.xcconfig"; path = "Target Support Files/Pods-SDWebImageLottiePlugin_Tests/Pods-SDWebImageLottiePlugin_Tests.release.xcconfig"; sourceTree = ""; };
51 | 607FACD01AFB9204008FA782 /* SDWebImageLottiePlugin_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SDWebImageLottiePlugin_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
52 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
53 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
54 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
55 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
56 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
57 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
58 | 607FACE51AFB9204008FA782 /* SDWebImageLottiePlugin_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SDWebImageLottiePlugin_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
59 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
60 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; };
61 | 6C65E20215E6C9B9FC9A68D3 /* Pods-SDWebImageLottiePlugin_Example macOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImageLottiePlugin_Example macOS.debug.xcconfig"; path = "Target Support Files/Pods-SDWebImageLottiePlugin_Example macOS/Pods-SDWebImageLottiePlugin_Example macOS.debug.xcconfig"; sourceTree = ""; };
62 | 71A05D8C6628E786CB71DAF6 /* Pods-SDWebImageLottiePlugin_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImageLottiePlugin_Tests.debug.xcconfig"; path = "Target Support Files/Pods-SDWebImageLottiePlugin_Tests/Pods-SDWebImageLottiePlugin_Tests.debug.xcconfig"; sourceTree = ""; };
63 | 81030B8908307D3E713DC8A7 /* Pods_SDWebImageLottiePlugin_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDWebImageLottiePlugin_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
64 | 9122A01A53A3D3143D4B6F21 /* Pods_SDWebImageLottiePlugin_Example_macOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDWebImageLottiePlugin_Example_macOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
65 | 9DA34A40BD006600CF64CF4E /* Pods-SDWebImageLottiePlugin_Example macOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImageLottiePlugin_Example macOS.release.xcconfig"; path = "Target Support Files/Pods-SDWebImageLottiePlugin_Example macOS/Pods-SDWebImageLottiePlugin_Example macOS.release.xcconfig"; sourceTree = ""; };
66 | B9C5C1EF9FDCB648339EA571 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; };
67 | BD49B9C626784E2C27B69814 /* SDWebImageLottiePlugin.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SDWebImageLottiePlugin.podspec; path = ../SDWebImageLottiePlugin.podspec; sourceTree = ""; };
68 | E32CA5B95EB732D4745F2D2E /* Pods_SDWebImageLottiePlugin_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDWebImageLottiePlugin_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
69 | /* End PBXFileReference section */
70 |
71 | /* Begin PBXFrameworksBuildPhase section */
72 | 3249A53C240A5ECB00AB1888 /* Frameworks */ = {
73 | isa = PBXFrameworksBuildPhase;
74 | buildActionMask = 2147483647;
75 | files = (
76 | 216B8040AC5A1CEBB8A1AADD /* Pods_SDWebImageLottiePlugin_Example_macOS.framework in Frameworks */,
77 | );
78 | runOnlyForDeploymentPostprocessing = 0;
79 | };
80 | 607FACCD1AFB9204008FA782 /* Frameworks */ = {
81 | isa = PBXFrameworksBuildPhase;
82 | buildActionMask = 2147483647;
83 | files = (
84 | 5769D4B693D39F4B51D7E517 /* Pods_SDWebImageLottiePlugin_Example.framework in Frameworks */,
85 | );
86 | runOnlyForDeploymentPostprocessing = 0;
87 | };
88 | 607FACE21AFB9204008FA782 /* Frameworks */ = {
89 | isa = PBXFrameworksBuildPhase;
90 | buildActionMask = 2147483647;
91 | files = (
92 | B0EA0AD78069CE0A18453D4A /* Pods_SDWebImageLottiePlugin_Tests.framework in Frameworks */,
93 | );
94 | runOnlyForDeploymentPostprocessing = 0;
95 | };
96 | /* End PBXFrameworksBuildPhase section */
97 |
98 | /* Begin PBXGroup section */
99 | 320F7B23240D0C1000272A7A /* images */ = {
100 | isa = PBXGroup;
101 | children = (
102 | 320F7B27240D0D2100272A7A /* img_0.png */,
103 | );
104 | path = images;
105 | sourceTree = "";
106 | };
107 | 320F7B24240D0C1700272A7A /* lotties */ = {
108 | isa = PBXGroup;
109 | children = (
110 | 320F7B25240D0C8900272A7A /* Assets.json */,
111 | );
112 | path = lotties;
113 | sourceTree = "";
114 | };
115 | 3249A540240A5ECB00AB1888 /* SDWebImageLottiePlugin Example macOS */ = {
116 | isa = PBXGroup;
117 | children = (
118 | 3249A541240A5ECB00AB1888 /* AppDelegate.swift */,
119 | 3249A543240A5ECB00AB1888 /* ViewController.swift */,
120 | 3249A545240A5ECE00AB1888 /* Assets.xcassets */,
121 | 3249A547240A5ECE00AB1888 /* Main.storyboard */,
122 | 3249A54A240A5ECE00AB1888 /* Info.plist */,
123 | 3249A54B240A5ECE00AB1888 /* SDWebImageLottiePlugin_Example_macOS.entitlements */,
124 | );
125 | path = "SDWebImageLottiePlugin Example macOS";
126 | sourceTree = "";
127 | };
128 | 463575D4F5B982E2E94D895F /* Frameworks */ = {
129 | isa = PBXGroup;
130 | children = (
131 | E32CA5B95EB732D4745F2D2E /* Pods_SDWebImageLottiePlugin_Example.framework */,
132 | 81030B8908307D3E713DC8A7 /* Pods_SDWebImageLottiePlugin_Tests.framework */,
133 | 9122A01A53A3D3143D4B6F21 /* Pods_SDWebImageLottiePlugin_Example_macOS.framework */,
134 | );
135 | name = Frameworks;
136 | sourceTree = "";
137 | };
138 | 607FACC71AFB9204008FA782 = {
139 | isa = PBXGroup;
140 | children = (
141 | 607FACF51AFB993E008FA782 /* Podspec Metadata */,
142 | 607FACD21AFB9204008FA782 /* SDWebImageLottiePlugin Example */,
143 | 3249A540240A5ECB00AB1888 /* SDWebImageLottiePlugin Example macOS */,
144 | 607FACE81AFB9204008FA782 /* Tests */,
145 | 607FACD11AFB9204008FA782 /* Products */,
146 | 667EE061F36F538EB946564A /* Pods */,
147 | 463575D4F5B982E2E94D895F /* Frameworks */,
148 | );
149 | sourceTree = "";
150 | };
151 | 607FACD11AFB9204008FA782 /* Products */ = {
152 | isa = PBXGroup;
153 | children = (
154 | 607FACD01AFB9204008FA782 /* SDWebImageLottiePlugin_Example.app */,
155 | 607FACE51AFB9204008FA782 /* SDWebImageLottiePlugin_Tests.xctest */,
156 | 3249A53F240A5ECB00AB1888 /* SDWebImageLottiePlugin_Example macOS.app */,
157 | );
158 | name = Products;
159 | sourceTree = "";
160 | };
161 | 607FACD21AFB9204008FA782 /* SDWebImageLottiePlugin Example */ = {
162 | isa = PBXGroup;
163 | children = (
164 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */,
165 | 607FACD71AFB9204008FA782 /* ViewController.swift */,
166 | 607FACD91AFB9204008FA782 /* Main.storyboard */,
167 | 607FACDC1AFB9204008FA782 /* Images.xcassets */,
168 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */,
169 | 607FACD31AFB9204008FA782 /* Supporting Files */,
170 | );
171 | name = "SDWebImageLottiePlugin Example";
172 | path = SDWebImageLottiePlugin;
173 | sourceTree = "";
174 | };
175 | 607FACD31AFB9204008FA782 /* Supporting Files */ = {
176 | isa = PBXGroup;
177 | children = (
178 | 607FACD41AFB9204008FA782 /* Info.plist */,
179 | );
180 | name = "Supporting Files";
181 | sourceTree = "";
182 | };
183 | 607FACE81AFB9204008FA782 /* Tests */ = {
184 | isa = PBXGroup;
185 | children = (
186 | 320F7B24240D0C1700272A7A /* lotties */,
187 | 320F7B23240D0C1000272A7A /* images */,
188 | 607FACEB1AFB9204008FA782 /* Tests.swift */,
189 | 607FACE91AFB9204008FA782 /* Supporting Files */,
190 | );
191 | path = Tests;
192 | sourceTree = "";
193 | };
194 | 607FACE91AFB9204008FA782 /* Supporting Files */ = {
195 | isa = PBXGroup;
196 | children = (
197 | 607FACEA1AFB9204008FA782 /* Info.plist */,
198 | );
199 | name = "Supporting Files";
200 | sourceTree = "";
201 | };
202 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = {
203 | isa = PBXGroup;
204 | children = (
205 | BD49B9C626784E2C27B69814 /* SDWebImageLottiePlugin.podspec */,
206 | 20A0C01111066EB216549706 /* README.md */,
207 | B9C5C1EF9FDCB648339EA571 /* LICENSE */,
208 | );
209 | name = "Podspec Metadata";
210 | sourceTree = "";
211 | };
212 | 667EE061F36F538EB946564A /* Pods */ = {
213 | isa = PBXGroup;
214 | children = (
215 | 338A760EC5B8FA4940015305 /* Pods-SDWebImageLottiePlugin_Example.debug.xcconfig */,
216 | 2D65A2027DF1B719B440F0EA /* Pods-SDWebImageLottiePlugin_Example.release.xcconfig */,
217 | 71A05D8C6628E786CB71DAF6 /* Pods-SDWebImageLottiePlugin_Tests.debug.xcconfig */,
218 | 4BC8F6E12F77DA65CA981B61 /* Pods-SDWebImageLottiePlugin_Tests.release.xcconfig */,
219 | 6C65E20215E6C9B9FC9A68D3 /* Pods-SDWebImageLottiePlugin_Example macOS.debug.xcconfig */,
220 | 9DA34A40BD006600CF64CF4E /* Pods-SDWebImageLottiePlugin_Example macOS.release.xcconfig */,
221 | );
222 | path = Pods;
223 | sourceTree = "";
224 | };
225 | /* End PBXGroup section */
226 |
227 | /* Begin PBXNativeTarget section */
228 | 3249A53E240A5ECB00AB1888 /* SDWebImageLottiePlugin_Example macOS */ = {
229 | isa = PBXNativeTarget;
230 | buildConfigurationList = 3249A54E240A5ECE00AB1888 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin_Example macOS" */;
231 | buildPhases = (
232 | CAA19A755F1A069E1FE7CBAB /* [CP] Check Pods Manifest.lock */,
233 | 3249A53B240A5ECB00AB1888 /* Sources */,
234 | 3249A53C240A5ECB00AB1888 /* Frameworks */,
235 | 3249A53D240A5ECB00AB1888 /* Resources */,
236 | 9484D3C067C9D5B887CB5000 /* [CP] Embed Pods Frameworks */,
237 | );
238 | buildRules = (
239 | );
240 | dependencies = (
241 | );
242 | name = "SDWebImageLottiePlugin_Example macOS";
243 | productName = "SDWebImageLottiePlugin_Example macOS";
244 | productReference = 3249A53F240A5ECB00AB1888 /* SDWebImageLottiePlugin_Example macOS.app */;
245 | productType = "com.apple.product-type.application";
246 | };
247 | 607FACCF1AFB9204008FA782 /* SDWebImageLottiePlugin_Example */ = {
248 | isa = PBXNativeTarget;
249 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin_Example" */;
250 | buildPhases = (
251 | 6762E0028EC1CDDDA4D810EE /* [CP] Check Pods Manifest.lock */,
252 | 607FACCC1AFB9204008FA782 /* Sources */,
253 | 607FACCD1AFB9204008FA782 /* Frameworks */,
254 | 607FACCE1AFB9204008FA782 /* Resources */,
255 | ED0D114341CE8268C2709C5F /* [CP] Embed Pods Frameworks */,
256 | );
257 | buildRules = (
258 | );
259 | dependencies = (
260 | );
261 | name = SDWebImageLottiePlugin_Example;
262 | productName = SDWebImageLottiePlugin;
263 | productReference = 607FACD01AFB9204008FA782 /* SDWebImageLottiePlugin_Example.app */;
264 | productType = "com.apple.product-type.application";
265 | };
266 | 607FACE41AFB9204008FA782 /* SDWebImageLottiePlugin_Tests */ = {
267 | isa = PBXNativeTarget;
268 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin_Tests" */;
269 | buildPhases = (
270 | 166AD72A2B56FE2BBBD640DC /* [CP] Check Pods Manifest.lock */,
271 | 607FACE11AFB9204008FA782 /* Sources */,
272 | 607FACE21AFB9204008FA782 /* Frameworks */,
273 | 607FACE31AFB9204008FA782 /* Resources */,
274 | 3E8B84B725A842F07BDFF00A /* [CP] Embed Pods Frameworks */,
275 | );
276 | buildRules = (
277 | );
278 | dependencies = (
279 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */,
280 | );
281 | name = SDWebImageLottiePlugin_Tests;
282 | productName = Tests;
283 | productReference = 607FACE51AFB9204008FA782 /* SDWebImageLottiePlugin_Tests.xctest */;
284 | productType = "com.apple.product-type.bundle.unit-test";
285 | };
286 | /* End PBXNativeTarget section */
287 |
288 | /* Begin PBXProject section */
289 | 607FACC81AFB9204008FA782 /* Project object */ = {
290 | isa = PBXProject;
291 | attributes = {
292 | LastSwiftUpdateCheck = 1130;
293 | LastUpgradeCheck = 0830;
294 | ORGANIZATIONNAME = CocoaPods;
295 | TargetAttributes = {
296 | 3249A53E240A5ECB00AB1888 = {
297 | CreatedOnToolsVersion = 11.3.1;
298 | ProvisioningStyle = Automatic;
299 | };
300 | 607FACCF1AFB9204008FA782 = {
301 | CreatedOnToolsVersion = 6.3.1;
302 | LastSwiftMigration = 0900;
303 | };
304 | 607FACE41AFB9204008FA782 = {
305 | CreatedOnToolsVersion = 6.3.1;
306 | LastSwiftMigration = 0900;
307 | TestTargetID = 607FACCF1AFB9204008FA782;
308 | };
309 | };
310 | };
311 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SDWebImageLottiePlugin" */;
312 | compatibilityVersion = "Xcode 3.2";
313 | developmentRegion = English;
314 | hasScannedForEncodings = 0;
315 | knownRegions = (
316 | English,
317 | en,
318 | Base,
319 | );
320 | mainGroup = 607FACC71AFB9204008FA782;
321 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */;
322 | projectDirPath = "";
323 | projectRoot = "";
324 | targets = (
325 | 607FACCF1AFB9204008FA782 /* SDWebImageLottiePlugin_Example */,
326 | 607FACE41AFB9204008FA782 /* SDWebImageLottiePlugin_Tests */,
327 | 3249A53E240A5ECB00AB1888 /* SDWebImageLottiePlugin_Example macOS */,
328 | );
329 | };
330 | /* End PBXProject section */
331 |
332 | /* Begin PBXResourcesBuildPhase section */
333 | 3249A53D240A5ECB00AB1888 /* Resources */ = {
334 | isa = PBXResourcesBuildPhase;
335 | buildActionMask = 2147483647;
336 | files = (
337 | 3249A546240A5ECE00AB1888 /* Assets.xcassets in Resources */,
338 | 3249A549240A5ECE00AB1888 /* Main.storyboard in Resources */,
339 | );
340 | runOnlyForDeploymentPostprocessing = 0;
341 | };
342 | 607FACCE1AFB9204008FA782 /* Resources */ = {
343 | isa = PBXResourcesBuildPhase;
344 | buildActionMask = 2147483647;
345 | files = (
346 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */,
347 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */,
348 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */,
349 | );
350 | runOnlyForDeploymentPostprocessing = 0;
351 | };
352 | 607FACE31AFB9204008FA782 /* Resources */ = {
353 | isa = PBXResourcesBuildPhase;
354 | buildActionMask = 2147483647;
355 | files = (
356 | 320F7B28240D0D2100272A7A /* img_0.png in Resources */,
357 | 320F7B26240D0C8900272A7A /* Assets.json in Resources */,
358 | );
359 | runOnlyForDeploymentPostprocessing = 0;
360 | };
361 | /* End PBXResourcesBuildPhase section */
362 |
363 | /* Begin PBXShellScriptBuildPhase section */
364 | 166AD72A2B56FE2BBBD640DC /* [CP] Check Pods Manifest.lock */ = {
365 | isa = PBXShellScriptBuildPhase;
366 | buildActionMask = 2147483647;
367 | files = (
368 | );
369 | inputFileListPaths = (
370 | );
371 | inputPaths = (
372 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
373 | "${PODS_ROOT}/Manifest.lock",
374 | );
375 | name = "[CP] Check Pods Manifest.lock";
376 | outputFileListPaths = (
377 | );
378 | outputPaths = (
379 | "$(DERIVED_FILE_DIR)/Pods-SDWebImageLottiePlugin_Tests-checkManifestLockResult.txt",
380 | );
381 | runOnlyForDeploymentPostprocessing = 0;
382 | shellPath = /bin/sh;
383 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
384 | showEnvVarsInLog = 0;
385 | };
386 | 3E8B84B725A842F07BDFF00A /* [CP] Embed Pods Frameworks */ = {
387 | isa = PBXShellScriptBuildPhase;
388 | buildActionMask = 2147483647;
389 | files = (
390 | );
391 | inputPaths = (
392 | "${PODS_ROOT}/Target Support Files/Pods-SDWebImageLottiePlugin_Tests/Pods-SDWebImageLottiePlugin_Tests-frameworks.sh",
393 | "${BUILT_PRODUCTS_DIR}/SDWebImage-iOS/SDWebImage.framework",
394 | "${BUILT_PRODUCTS_DIR}/SDWebImageLottiePlugin-iOS/SDWebImageLottiePlugin.framework",
395 | "${BUILT_PRODUCTS_DIR}/lottie-ios-iOS/Lottie.framework",
396 | );
397 | name = "[CP] Embed Pods Frameworks";
398 | outputPaths = (
399 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
400 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageLottiePlugin.framework",
401 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework",
402 | );
403 | runOnlyForDeploymentPostprocessing = 0;
404 | shellPath = /bin/sh;
405 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SDWebImageLottiePlugin_Tests/Pods-SDWebImageLottiePlugin_Tests-frameworks.sh\"\n";
406 | showEnvVarsInLog = 0;
407 | };
408 | 6762E0028EC1CDDDA4D810EE /* [CP] Check Pods Manifest.lock */ = {
409 | isa = PBXShellScriptBuildPhase;
410 | buildActionMask = 2147483647;
411 | files = (
412 | );
413 | inputFileListPaths = (
414 | );
415 | inputPaths = (
416 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
417 | "${PODS_ROOT}/Manifest.lock",
418 | );
419 | name = "[CP] Check Pods Manifest.lock";
420 | outputFileListPaths = (
421 | );
422 | outputPaths = (
423 | "$(DERIVED_FILE_DIR)/Pods-SDWebImageLottiePlugin_Example-checkManifestLockResult.txt",
424 | );
425 | runOnlyForDeploymentPostprocessing = 0;
426 | shellPath = /bin/sh;
427 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
428 | showEnvVarsInLog = 0;
429 | };
430 | 9484D3C067C9D5B887CB5000 /* [CP] Embed Pods Frameworks */ = {
431 | isa = PBXShellScriptBuildPhase;
432 | buildActionMask = 2147483647;
433 | files = (
434 | );
435 | inputPaths = (
436 | "${PODS_ROOT}/Target Support Files/Pods-SDWebImageLottiePlugin_Example macOS/Pods-SDWebImageLottiePlugin_Example macOS-frameworks.sh",
437 | "${BUILT_PRODUCTS_DIR}/SDWebImage-macOS/SDWebImage.framework",
438 | "${BUILT_PRODUCTS_DIR}/SDWebImageLottiePlugin-macOS/SDWebImageLottiePlugin.framework",
439 | "${BUILT_PRODUCTS_DIR}/lottie-ios-macOS/Lottie.framework",
440 | );
441 | name = "[CP] Embed Pods Frameworks";
442 | outputPaths = (
443 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
444 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageLottiePlugin.framework",
445 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework",
446 | );
447 | runOnlyForDeploymentPostprocessing = 0;
448 | shellPath = /bin/sh;
449 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SDWebImageLottiePlugin_Example macOS/Pods-SDWebImageLottiePlugin_Example macOS-frameworks.sh\"\n";
450 | showEnvVarsInLog = 0;
451 | };
452 | CAA19A755F1A069E1FE7CBAB /* [CP] Check Pods Manifest.lock */ = {
453 | isa = PBXShellScriptBuildPhase;
454 | buildActionMask = 2147483647;
455 | files = (
456 | );
457 | inputFileListPaths = (
458 | );
459 | inputPaths = (
460 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
461 | "${PODS_ROOT}/Manifest.lock",
462 | );
463 | name = "[CP] Check Pods Manifest.lock";
464 | outputFileListPaths = (
465 | );
466 | outputPaths = (
467 | "$(DERIVED_FILE_DIR)/Pods-SDWebImageLottiePlugin_Example macOS-checkManifestLockResult.txt",
468 | );
469 | runOnlyForDeploymentPostprocessing = 0;
470 | shellPath = /bin/sh;
471 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
472 | showEnvVarsInLog = 0;
473 | };
474 | ED0D114341CE8268C2709C5F /* [CP] Embed Pods Frameworks */ = {
475 | isa = PBXShellScriptBuildPhase;
476 | buildActionMask = 2147483647;
477 | files = (
478 | );
479 | inputPaths = (
480 | "${PODS_ROOT}/Target Support Files/Pods-SDWebImageLottiePlugin_Example/Pods-SDWebImageLottiePlugin_Example-frameworks.sh",
481 | "${BUILT_PRODUCTS_DIR}/SDWebImage-iOS/SDWebImage.framework",
482 | "${BUILT_PRODUCTS_DIR}/SDWebImageLottiePlugin-iOS/SDWebImageLottiePlugin.framework",
483 | "${BUILT_PRODUCTS_DIR}/lottie-ios-iOS/Lottie.framework",
484 | );
485 | name = "[CP] Embed Pods Frameworks";
486 | outputPaths = (
487 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
488 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageLottiePlugin.framework",
489 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework",
490 | );
491 | runOnlyForDeploymentPostprocessing = 0;
492 | shellPath = /bin/sh;
493 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SDWebImageLottiePlugin_Example/Pods-SDWebImageLottiePlugin_Example-frameworks.sh\"\n";
494 | showEnvVarsInLog = 0;
495 | };
496 | /* End PBXShellScriptBuildPhase section */
497 |
498 | /* Begin PBXSourcesBuildPhase section */
499 | 3249A53B240A5ECB00AB1888 /* Sources */ = {
500 | isa = PBXSourcesBuildPhase;
501 | buildActionMask = 2147483647;
502 | files = (
503 | 3249A544240A5ECB00AB1888 /* ViewController.swift in Sources */,
504 | 3249A542240A5ECB00AB1888 /* AppDelegate.swift in Sources */,
505 | );
506 | runOnlyForDeploymentPostprocessing = 0;
507 | };
508 | 607FACCC1AFB9204008FA782 /* Sources */ = {
509 | isa = PBXSourcesBuildPhase;
510 | buildActionMask = 2147483647;
511 | files = (
512 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
513 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
514 | );
515 | runOnlyForDeploymentPostprocessing = 0;
516 | };
517 | 607FACE11AFB9204008FA782 /* Sources */ = {
518 | isa = PBXSourcesBuildPhase;
519 | buildActionMask = 2147483647;
520 | files = (
521 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */,
522 | );
523 | runOnlyForDeploymentPostprocessing = 0;
524 | };
525 | /* End PBXSourcesBuildPhase section */
526 |
527 | /* Begin PBXTargetDependency section */
528 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = {
529 | isa = PBXTargetDependency;
530 | target = 607FACCF1AFB9204008FA782 /* SDWebImageLottiePlugin_Example */;
531 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */;
532 | };
533 | /* End PBXTargetDependency section */
534 |
535 | /* Begin PBXVariantGroup section */
536 | 3249A547240A5ECE00AB1888 /* Main.storyboard */ = {
537 | isa = PBXVariantGroup;
538 | children = (
539 | 3249A548240A5ECE00AB1888 /* Base */,
540 | );
541 | name = Main.storyboard;
542 | sourceTree = "";
543 | };
544 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = {
545 | isa = PBXVariantGroup;
546 | children = (
547 | 607FACDA1AFB9204008FA782 /* Base */,
548 | );
549 | name = Main.storyboard;
550 | sourceTree = "";
551 | };
552 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = {
553 | isa = PBXVariantGroup;
554 | children = (
555 | 607FACDF1AFB9204008FA782 /* Base */,
556 | );
557 | name = LaunchScreen.xib;
558 | sourceTree = "";
559 | };
560 | /* End PBXVariantGroup section */
561 |
562 | /* Begin XCBuildConfiguration section */
563 | 3249A54C240A5ECE00AB1888 /* Debug */ = {
564 | isa = XCBuildConfiguration;
565 | baseConfigurationReference = 6C65E20215E6C9B9FC9A68D3 /* Pods-SDWebImageLottiePlugin_Example macOS.debug.xcconfig */;
566 | buildSettings = {
567 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
568 | CLANG_ANALYZER_NONNULL = YES;
569 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
570 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
571 | CLANG_ENABLE_OBJC_WEAK = YES;
572 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
573 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
574 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
575 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
576 | CODE_SIGN_ENTITLEMENTS = "SDWebImageLottiePlugin Example macOS/SDWebImageLottiePlugin_Example_macOS.entitlements";
577 | CODE_SIGN_STYLE = Automatic;
578 | COMBINE_HIDPI_IMAGES = YES;
579 | DEBUG_INFORMATION_FORMAT = dwarf;
580 | GCC_C_LANGUAGE_STANDARD = gnu11;
581 | INFOPLIST_FILE = "SDWebImageLottiePlugin Example macOS/Info.plist";
582 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
583 | MACOSX_DEPLOYMENT_TARGET = 10.13;
584 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
585 | MTL_FAST_MATH = YES;
586 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SDWebImageLottiePlugin-Example-macOS";
587 | PRODUCT_NAME = "$(TARGET_NAME)";
588 | SDKROOT = macosx;
589 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
590 | SWIFT_VERSION = 5.0;
591 | };
592 | name = Debug;
593 | };
594 | 3249A54D240A5ECE00AB1888 /* Release */ = {
595 | isa = XCBuildConfiguration;
596 | baseConfigurationReference = 9DA34A40BD006600CF64CF4E /* Pods-SDWebImageLottiePlugin_Example macOS.release.xcconfig */;
597 | buildSettings = {
598 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
599 | CLANG_ANALYZER_NONNULL = YES;
600 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
601 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
602 | CLANG_ENABLE_OBJC_WEAK = YES;
603 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
604 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
605 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
606 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
607 | CODE_SIGN_ENTITLEMENTS = "SDWebImageLottiePlugin Example macOS/SDWebImageLottiePlugin_Example_macOS.entitlements";
608 | CODE_SIGN_STYLE = Automatic;
609 | COMBINE_HIDPI_IMAGES = YES;
610 | GCC_C_LANGUAGE_STANDARD = gnu11;
611 | INFOPLIST_FILE = "SDWebImageLottiePlugin Example macOS/Info.plist";
612 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
613 | MACOSX_DEPLOYMENT_TARGET = 10.13;
614 | MTL_FAST_MATH = YES;
615 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SDWebImageLottiePlugin-Example-macOS";
616 | PRODUCT_NAME = "$(TARGET_NAME)";
617 | SDKROOT = macosx;
618 | SWIFT_VERSION = 5.0;
619 | };
620 | name = Release;
621 | };
622 | 607FACED1AFB9204008FA782 /* Debug */ = {
623 | isa = XCBuildConfiguration;
624 | buildSettings = {
625 | ALWAYS_SEARCH_USER_PATHS = NO;
626 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
627 | CLANG_CXX_LIBRARY = "libc++";
628 | CLANG_ENABLE_MODULES = YES;
629 | CLANG_ENABLE_OBJC_ARC = YES;
630 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
631 | CLANG_WARN_BOOL_CONVERSION = YES;
632 | CLANG_WARN_COMMA = YES;
633 | CLANG_WARN_CONSTANT_CONVERSION = YES;
634 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
635 | CLANG_WARN_EMPTY_BODY = YES;
636 | CLANG_WARN_ENUM_CONVERSION = YES;
637 | CLANG_WARN_INFINITE_RECURSION = YES;
638 | CLANG_WARN_INT_CONVERSION = YES;
639 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
640 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
641 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
642 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
643 | CLANG_WARN_STRICT_PROTOTYPES = YES;
644 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
645 | CLANG_WARN_UNREACHABLE_CODE = YES;
646 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
647 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
648 | COPY_PHASE_STRIP = NO;
649 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
650 | ENABLE_STRICT_OBJC_MSGSEND = YES;
651 | ENABLE_TESTABILITY = YES;
652 | GCC_C_LANGUAGE_STANDARD = gnu99;
653 | GCC_DYNAMIC_NO_PIC = NO;
654 | GCC_NO_COMMON_BLOCKS = YES;
655 | GCC_OPTIMIZATION_LEVEL = 0;
656 | GCC_PREPROCESSOR_DEFINITIONS = (
657 | "DEBUG=1",
658 | "$(inherited)",
659 | );
660 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
661 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
662 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
663 | GCC_WARN_UNDECLARED_SELECTOR = YES;
664 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
665 | GCC_WARN_UNUSED_FUNCTION = YES;
666 | GCC_WARN_UNUSED_VARIABLE = YES;
667 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
668 | MTL_ENABLE_DEBUG_INFO = YES;
669 | ONLY_ACTIVE_ARCH = YES;
670 | SDKROOT = iphoneos;
671 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
672 | };
673 | name = Debug;
674 | };
675 | 607FACEE1AFB9204008FA782 /* Release */ = {
676 | isa = XCBuildConfiguration;
677 | buildSettings = {
678 | ALWAYS_SEARCH_USER_PATHS = NO;
679 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
680 | CLANG_CXX_LIBRARY = "libc++";
681 | CLANG_ENABLE_MODULES = YES;
682 | CLANG_ENABLE_OBJC_ARC = YES;
683 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
684 | CLANG_WARN_BOOL_CONVERSION = YES;
685 | CLANG_WARN_COMMA = YES;
686 | CLANG_WARN_CONSTANT_CONVERSION = YES;
687 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
688 | CLANG_WARN_EMPTY_BODY = YES;
689 | CLANG_WARN_ENUM_CONVERSION = YES;
690 | CLANG_WARN_INFINITE_RECURSION = YES;
691 | CLANG_WARN_INT_CONVERSION = YES;
692 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
693 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
694 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
695 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
696 | CLANG_WARN_STRICT_PROTOTYPES = YES;
697 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
698 | CLANG_WARN_UNREACHABLE_CODE = YES;
699 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
700 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
701 | COPY_PHASE_STRIP = NO;
702 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
703 | ENABLE_NS_ASSERTIONS = NO;
704 | ENABLE_STRICT_OBJC_MSGSEND = YES;
705 | GCC_C_LANGUAGE_STANDARD = gnu99;
706 | GCC_NO_COMMON_BLOCKS = YES;
707 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
708 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
709 | GCC_WARN_UNDECLARED_SELECTOR = YES;
710 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
711 | GCC_WARN_UNUSED_FUNCTION = YES;
712 | GCC_WARN_UNUSED_VARIABLE = YES;
713 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
714 | MTL_ENABLE_DEBUG_INFO = NO;
715 | SDKROOT = iphoneos;
716 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
717 | VALIDATE_PRODUCT = YES;
718 | };
719 | name = Release;
720 | };
721 | 607FACF01AFB9204008FA782 /* Debug */ = {
722 | isa = XCBuildConfiguration;
723 | baseConfigurationReference = 338A760EC5B8FA4940015305 /* Pods-SDWebImageLottiePlugin_Example.debug.xcconfig */;
724 | buildSettings = {
725 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
726 | INFOPLIST_FILE = SDWebImageLottiePlugin/Info.plist;
727 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
728 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
729 | MODULE_NAME = ExampleApp;
730 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
731 | PRODUCT_NAME = "$(TARGET_NAME)";
732 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
733 | SWIFT_VERSION = 4.0;
734 | };
735 | name = Debug;
736 | };
737 | 607FACF11AFB9204008FA782 /* Release */ = {
738 | isa = XCBuildConfiguration;
739 | baseConfigurationReference = 2D65A2027DF1B719B440F0EA /* Pods-SDWebImageLottiePlugin_Example.release.xcconfig */;
740 | buildSettings = {
741 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
742 | INFOPLIST_FILE = SDWebImageLottiePlugin/Info.plist;
743 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
744 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
745 | MODULE_NAME = ExampleApp;
746 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
747 | PRODUCT_NAME = "$(TARGET_NAME)";
748 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
749 | SWIFT_VERSION = 4.0;
750 | };
751 | name = Release;
752 | };
753 | 607FACF31AFB9204008FA782 /* Debug */ = {
754 | isa = XCBuildConfiguration;
755 | baseConfigurationReference = 71A05D8C6628E786CB71DAF6 /* Pods-SDWebImageLottiePlugin_Tests.debug.xcconfig */;
756 | buildSettings = {
757 | FRAMEWORK_SEARCH_PATHS = (
758 | "$(PLATFORM_DIR)/Developer/Library/Frameworks",
759 | "$(inherited)",
760 | );
761 | GCC_PREPROCESSOR_DEFINITIONS = (
762 | "DEBUG=1",
763 | "$(inherited)",
764 | );
765 | INFOPLIST_FILE = Tests/Info.plist;
766 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
767 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
768 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
769 | PRODUCT_NAME = "$(TARGET_NAME)";
770 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
771 | SWIFT_VERSION = 4.0;
772 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SDWebImageLottiePlugin_Example.app/SDWebImageLottiePlugin_Example";
773 | };
774 | name = Debug;
775 | };
776 | 607FACF41AFB9204008FA782 /* Release */ = {
777 | isa = XCBuildConfiguration;
778 | baseConfigurationReference = 4BC8F6E12F77DA65CA981B61 /* Pods-SDWebImageLottiePlugin_Tests.release.xcconfig */;
779 | buildSettings = {
780 | FRAMEWORK_SEARCH_PATHS = (
781 | "$(PLATFORM_DIR)/Developer/Library/Frameworks",
782 | "$(inherited)",
783 | );
784 | INFOPLIST_FILE = Tests/Info.plist;
785 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
786 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
787 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
788 | PRODUCT_NAME = "$(TARGET_NAME)";
789 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
790 | SWIFT_VERSION = 4.0;
791 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SDWebImageLottiePlugin_Example.app/SDWebImageLottiePlugin_Example";
792 | };
793 | name = Release;
794 | };
795 | /* End XCBuildConfiguration section */
796 |
797 | /* Begin XCConfigurationList section */
798 | 3249A54E240A5ECE00AB1888 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin_Example macOS" */ = {
799 | isa = XCConfigurationList;
800 | buildConfigurations = (
801 | 3249A54C240A5ECE00AB1888 /* Debug */,
802 | 3249A54D240A5ECE00AB1888 /* Release */,
803 | );
804 | defaultConfigurationIsVisible = 0;
805 | defaultConfigurationName = Release;
806 | };
807 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SDWebImageLottiePlugin" */ = {
808 | isa = XCConfigurationList;
809 | buildConfigurations = (
810 | 607FACED1AFB9204008FA782 /* Debug */,
811 | 607FACEE1AFB9204008FA782 /* Release */,
812 | );
813 | defaultConfigurationIsVisible = 0;
814 | defaultConfigurationName = Release;
815 | };
816 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin_Example" */ = {
817 | isa = XCConfigurationList;
818 | buildConfigurations = (
819 | 607FACF01AFB9204008FA782 /* Debug */,
820 | 607FACF11AFB9204008FA782 /* Release */,
821 | );
822 | defaultConfigurationIsVisible = 0;
823 | defaultConfigurationName = Release;
824 | };
825 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin_Tests" */ = {
826 | isa = XCConfigurationList;
827 | buildConfigurations = (
828 | 607FACF31AFB9204008FA782 /* Debug */,
829 | 607FACF41AFB9204008FA782 /* Release */,
830 | );
831 | defaultConfigurationIsVisible = 0;
832 | defaultConfigurationName = Release;
833 | };
834 | /* End XCConfigurationList section */
835 | };
836 | rootObject = 607FACC81AFB9204008FA782 /* Project object */;
837 | }
838 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin.xcodeproj/xcshareddata/xcschemes/SDWebImageLottiePlugin-Example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
51 |
52 |
53 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
76 |
78 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin.xcodeproj/xcshareddata/xcschemes/SDWebImageLottiePlugin_Example macOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
45 |
51 |
52 |
53 |
54 |
60 |
62 |
68 |
69 |
70 |
71 |
73 |
74 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin.xcodeproj/xcshareddata/xcschemes/SDWebImageLottiePlugin_Tests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
34 |
40 |
41 |
42 |
43 |
44 |
54 |
55 |
61 |
62 |
68 |
69 |
70 |
71 |
73 |
74 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) DreamPiggy
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | import UIKit
10 | import Lottie
11 |
12 | @UIApplicationMain
13 | class AppDelegate: UIResponder, UIApplicationDelegate {
14 |
15 | var window: UIWindow?
16 |
17 |
18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
19 | LottieConfiguration.shared.renderingEngine = .coreAnimation
20 | // Override point for customization after application launch.
21 | return true
22 | }
23 |
24 | func applicationWillResignActive(_ application: UIApplication) {
25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
26 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
27 | }
28 |
29 | func applicationDidEnterBackground(_ application: UIApplication) {
30 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
32 | }
33 |
34 | func applicationWillEnterForeground(_ application: UIApplication) {
35 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
36 | }
37 |
38 | func applicationDidBecomeActive(_ application: UIApplication) {
39 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
40 | }
41 |
42 | func applicationWillTerminate(_ application: UIApplication) {
43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 | }
45 |
46 |
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
25 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Example/SDWebImageLottiePlugin/ViewController.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) DreamPiggy
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | import UIKit
10 | import Lottie
11 | import SDWebImageLottiePlugin
12 | import SDWebImage
13 |
14 | class ViewController: UIViewController {
15 |
16 | let animationView = AnimationView()
17 |
18 | override func viewDidLoad() {
19 | super.viewDidLoad()
20 | animationView.contentMode = .scaleAspectFit
21 | animationView.frame = self.view.bounds
22 | animationView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
23 | view.addSubview(animationView)
24 |
25 | let lottieUrl = URL(string: "https://raw.githubusercontent.com/airbnb/lottie-web/master/demo/gatin/data.json")
26 | animationView.sd_setImage(with: lottieUrl, completed: { _,_,_,_ in
27 | self.animationView.play(fromProgress: 0, toProgress: 1, loopMode: .repeat(5)) { finished in
28 | if finished {
29 | print("Animation Complete")
30 | } else {
31 | print("Animation cancelled")
32 | }
33 | }
34 | })
35 | }
36 |
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/Example/Screenshot/LottieDemo-macOS.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SDWebImage/SDWebImageLottiePlugin/d4ae63250f856cb382ecf80f14df12e78e9e0f0b/Example/Screenshot/LottieDemo-macOS.gif
--------------------------------------------------------------------------------
/Example/Screenshot/LottieDemo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SDWebImage/SDWebImageLottiePlugin/d4ae63250f856cb382ecf80f14df12e78e9e0f0b/Example/Screenshot/LottieDemo.gif
--------------------------------------------------------------------------------
/Example/Tests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/Tests/Tests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import Lottie
3 | import SDWebImage
4 | @testable import SDWebImageLottiePlugin
5 |
6 | extension UIColor {
7 | func toHexString() -> String {
8 | var r: CGFloat = 0
9 | var g: CGFloat = 0
10 | var b: CGFloat = 0
11 | var a: CGFloat = 0
12 |
13 | getRed(&r, green: &g, blue: &b, alpha: &a)
14 |
15 | let rgb: Int = (Int)(r*255)<<16 | (Int)(g*255)<<8 | (Int)(b*255)<<0
16 |
17 | return String(format: "#%06x", rgb)
18 | }
19 | }
20 |
21 | class Tests: XCTestCase {
22 |
23 | override func setUp() {
24 | super.setUp()
25 | // Put setup code here. This method is called before the invocation of each test method in the class.
26 | }
27 |
28 | override func tearDown() {
29 | // Put teardown code here. This method is called after the invocation of each test method in the class.
30 | super.tearDown()
31 | }
32 |
33 | func testExample() {
34 | // This is an example of a functional test case.
35 | XCTAssert(true, "Pass")
36 | }
37 |
38 | func testAnimatedImageViewLoad() {
39 | let exception = self.expectation(description: "AnimationView load lottie URL")
40 | let animationView = AnimationView()
41 | let lottieURL = URL(string: "https://raw.githubusercontent.com/airbnb/lottie-web/master/demo/happy2016/data.json")
42 | animationView.sd_setImage(with: lottieURL, completed: { (image, error, cacheType, url) in
43 | XCTAssertNil(error)
44 | let lottieImage = try! XCTUnwrap(image)
45 | XCTAssertTrue(lottieImage.isKind(of: LottieImage.self))
46 | let animation = try! XCTUnwrap((lottieImage as! LottieImage).animation)
47 | XCTAssertEqual(animation.size, CGSize(width: 1920, height: 1080))
48 | exception.fulfill()
49 | })
50 | self.waitForExpectations(timeout: 5, handler: nil)
51 | }
52 |
53 | func testAnimatedControlLoad() {
54 | let exception = self.expectation(description: "AnimatedControl load lottie URL")
55 | let animationView = AnimatedSwitch()
56 | let lottieURL = URL(string: "https://raw.githubusercontent.com/airbnb/lottie-web/master/demo/adrock/data.json")
57 | animationView.sd_setImage(with: lottieURL, completed: { (image, error, cacheType, url) in
58 | XCTAssertNil(error)
59 | let lottieImage = try! XCTUnwrap(image)
60 | XCTAssertTrue(lottieImage.isKind(of: LottieImage.self))
61 | let animation = try! XCTUnwrap((lottieImage as! LottieImage).animation)
62 | XCTAssertEqual(animation.size, CGSize(width: 690, height: 913))
63 | exception.fulfill()
64 | })
65 | self.waitForExpectations(timeout: 5, handler: nil)
66 | }
67 |
68 | func testLottieImageWithBundle() throws {
69 | let bundle = Bundle(for: type(of: self))
70 | let fileURL = bundle.url(forResource: "Assets", withExtension: "json")!
71 | let lottieData = try Data(contentsOf: fileURL)
72 | let animation = try JSONDecoder().decode(Animation.self, from: lottieData)
73 | let animationView = AnimationView(animation: animation, imageProvider: BundleImageProvider(bundle: bundle, searchPath: nil))
74 | let renderer = SDGraphicsImageRenderer(size: animation.size)
75 | let viewImage = renderer.image { context in
76 | animationView.drawHierarchy(in: CGRect(origin: CGPoint(x: 0, y: 0), size: animation.size), afterScreenUpdates: true)
77 | }
78 | // Pick the color to check
79 | let color1 = try XCTUnwrap(viewImage.sd_color(at: CGPoint(x: 150, y: 150)))
80 | XCTAssertEqual(color1.toHexString(), "#00d1c1");
81 |
82 | let lottieImage = LottieImage(animation: animation)
83 | lottieImage.imageProvider = BundleImageProvider(bundle: bundle, searchPath: nil)
84 | let posterFrame = try XCTUnwrap(lottieImage.animatedImageFrame(at: 0))
85 | // Pick the color to check
86 | let color2 = try XCTUnwrap(posterFrame.sd_color(at: CGPoint(x: 150, y: 150)))
87 | XCTAssertEqual(color2.toHexString(), "#00d1c1");
88 | }
89 |
90 |
91 | func testLottieImageExtractFrame() {
92 | let exception = self.expectation(description: "LottieImage extract frame")
93 | let lottieUrl = URL(string: "https://raw.githubusercontent.com/airbnb/lottie-web/master/demo/gatin/data.json")!
94 | let task = URLSession.shared.dataTask(with: lottieUrl) { data, _, _ in
95 | if let data = data, let animation = try? JSONDecoder().decode(Animation.self, from: data) {
96 | let lottieImage = LottieImage(animation: animation)
97 | let frameCount = lottieImage.animatedImageFrameCount
98 | XCTAssertEqual(frameCount, 80)
99 | let posterFrame = lottieImage.animatedImageFrame(at: 0)
100 | let lastFrame = lottieImage.animatedImageFrame(at: frameCount - 1)
101 | XCTAssertNotNil(posterFrame)
102 | XCTAssertNotNil(lastFrame)
103 | XCTAssertNotEqual(posterFrame, lastFrame)
104 | exception.fulfill()
105 | } else {
106 | XCTFail()
107 | }
108 | }
109 | task.resume()
110 | self.waitForExpectations(timeout: 5, handler: nil)
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/Example/Tests/images/img_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SDWebImage/SDWebImageLottiePlugin/d4ae63250f856cb382ecf80f14df12e78e9e0f0b/Example/Tests/images/img_0.png
--------------------------------------------------------------------------------
/Example/Tests/lotties/Assets.json:
--------------------------------------------------------------------------------
1 | {"v":"5.1.7","fr":24,"ip":0,"op":120,"w":200,"h":200,"nm":"Assets","ddd":0,"assets":[{"id":"image_0","w":128,"h":126,"u":"images/","p":"img_0.png"},{"id":"comp_0","layers":[]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"PrecompComp","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[100,100,0],"ix":2},"a":{"a":0,"k":[100,100,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":200,"h":200,"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"Lottie.png","cl":"png","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[100,100,0],"ix":2},"a":{"a":0,"k":[64,63,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":120,"st":0,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2020 lizhuoli1126@126.com
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Package.resolved:
--------------------------------------------------------------------------------
1 | {
2 | "object": {
3 | "pins": [
4 | {
5 | "package": "Lottie",
6 | "repositoryURL": "https://github.com/airbnb/lottie-ios.git",
7 | "state": {
8 | "branch": null,
9 | "revision": "246bab7ef72bad56abefb88e84a08871cecf9cb8",
10 | "version": "3.4.0"
11 | }
12 | },
13 | {
14 | "package": "SDWebImage",
15 | "repositoryURL": "https://github.com/SDWebImage/SDWebImage.git",
16 | "state": {
17 | "branch": null,
18 | "revision": "c4b8660bb3ef543fe4bdcaac0db956b32dc5583f",
19 | "version": "5.13.0"
20 | }
21 | }
22 | ]
23 | },
24 | "version": 1
25 | }
26 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.1
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 |
4 | import PackageDescription
5 |
6 | let package = Package(
7 | name: "SDWebImageLottiePlugin",
8 | platforms: [
9 | .iOS(.v11),
10 | .tvOS(.v11),
11 | .macOS(.v10_11)
12 | ],
13 | products: [
14 | // Products define the executables and libraries produced by a package, and make them visible to other packages.
15 | .library(
16 | name: "SDWebImageLottiePlugin",
17 | targets: ["SDWebImageLottiePlugin"]),
18 | ],
19 | dependencies: [
20 | // Dependencies declare other packages that this package depends on.
21 | // .package(url: /* package url */, from: "1.0.0"),
22 | .package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.10.0"),
23 | .package(url: "https://github.com/airbnb/lottie-ios.git", from: "3.4.0")
24 | ],
25 | targets: [
26 | // Targets are the basic building blocks of a package. A target can define a module or a test suite.
27 | // Targets can depend on other targets in this package, and on products in packages which this package depends on.
28 | .target(
29 | name: "SDWebImageLottiePlugin",
30 | dependencies: ["SDWebImage", "Lottie"],
31 | path: ".",
32 | sources: ["SDWebImageLottiePlugin/Classes"],
33 | publicHeadersPath: "SDWebImageLottiePlugin/Classes"
34 | )
35 | ]
36 | )
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SDWebImageLottiePlugin
2 |
3 | [](https://travis-ci.org/SDWebImage/SDWebImageLottiePlugin)
4 | [](https://cocoapods.org/pods/SDWebImageLottiePlugin)
5 | [](https://cocoapods.org/pods/SDWebImageLottiePlugin)
6 | [](https://cocoapods.org/pods/SDWebImageLottiePlugin)
7 | [](https://github.com/SDWebImage/SDWebImageLottiePlugin)
8 | [](https://codecov.io/gh/SDWebImage/SDWebImageLottiePlugin)
9 |
10 | ## What's for
11 | SDWebImageLottiePlugin is a plugin for [SDWebImage](https://github.com/rs/SDWebImage/) framework, which provide the [Lottie](https://github.com/airbnb/lottie-ios) animation loading from JSON file.
12 |
13 | You can find more resource about Lottie in their [Official Site](https://airbnb.design/lottie/).
14 |
15 | ## Requirements
16 |
17 | + iOS 11+
18 | + macOS 10.11+
19 | + tvOS 11+
20 | + Xcode 11+
21 |
22 | ## Installation
23 |
24 | #### Swift Package Manager
25 |
26 | SDWebImageWebPCoder is available through [Swift Package Manager](https://swift.org/package-manager).
27 |
28 | ```swift
29 | let package = Package(
30 | dependencies: [
31 | .package(url: "https://github.com/SDWebImage/SDWebImageLottiePlugin.git", from: "1.0.0")
32 | ]
33 | )
34 | ```
35 |
36 | #### CocoaPods
37 |
38 | SDWebImageLottiePlugin is available through [CocoaPods](https://cocoapods.org). To install
39 | it, simply add the following line to your Podfile:
40 |
41 | ```ruby
42 | pod 'SDWebImageLottiePlugin', '~> 1.0'
43 | ```
44 |
45 | #### Carthage (Deprecated)
46 |
47 | SDWebImageLottiePlugin is available through [Carthage](https://github.com/Carthage/Carthage).
48 |
49 | ```
50 | github "SDWebImage/SDWebImageLottiePlugin", ~> 1.0
51 | ```
52 |
53 | Note:
54 | 1. Carthage macOS integration contains issue, because the module name is `Lottie_macOS` but not `Lottie`, wait the issue [here](https://github.com/airbnb/lottie-ios/issues/1638) been fixed 👀
55 |
56 | ## Lottie 2 && Objective-C
57 |
58 | Lottie 3.4 version's `LottieConfiguration.shared.renderingEngine = .coreAnimation` solve the huge performance regression in the issue [here](https://github.com/airbnb/lottie-ios/issues/895) 🚀
59 |
60 | So from SDWebImageLottiePlugin v1.0.0, we drop the Lottie 2 support, as well as the Objective-C support because Lottie 3 use pure Swift. And therefore, we drop the iOS 9-10 support because the upstream dependency need iOS 11+.
61 |
62 | For user who still use Lottie 2 and Objective-C, please check the 0.x version updated to [0.3.0](https://github.com/SDWebImage/SDWebImageLottiePlugin/releases/tag/0.3.0)
63 |
64 | ## Usage
65 |
66 | ### Load Lottie from remote JSON
67 |
68 | + Swift
69 |
70 | ```swift
71 | let animationView: Lottie.AnimationView
72 | let lottieJSONURL: URL
73 | animationView.sd_setImage(with: lottieJSONURL)
74 | ```
75 |
76 | Note:
77 | + You can also load lottie json files on `AnimatedControl`, like switch button.
78 | + Lottie animation does not start automatically, you can use the completion block, or UITableView/UICollectionView's will display timing to play.
79 |
80 | ```swift
81 | animationView.sd_setImage(with: lottieUrl, completed: { _,_,_,_ in
82 | self.animationView.play(fromProgress: 0, toProgress: 1, loopMode: .repeat(5)) { finished in
83 | // ...
84 | }
85 | }
86 | ```
87 |
88 |
89 | + If your Lottie json files contains references to App bundle images, just set the `imageProvider` before the lottie animation start.
90 |
91 | ```swift
92 | let bundle = Bundle(for: MyBundleClass.self)
93 | animationView.imageProvider = BundleImageProvider(bundle: bundle, searchPath: nil)
94 | animationView.sd_setImage(with: lottieUrl)
95 | ```
96 |
97 | ### Advanced usage
98 |
99 | This Lottie plugin use a wrapper class `LottieImage` 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.
100 |
101 | + Swift
102 |
103 | ```swift
104 | let animation = try? JSONDecoder().decode(Animation.self, from: data)
105 | let animatedImage = LottieImage(animation: animation)
106 | // Optional, custom image bundle
107 | animatedImage.imageProvider = BundleImageProvider(bundle: bundle, searchPath: nil)
108 | // Snapshot Lottie animation frame
109 | let posterFrame = animatedImage.animatedImageFrame(at: 0)
110 | let duration = animatedImage.animatedImageDuration(at: 0)
111 | ```
112 |
113 | Note:
114 | + The snapshot is a bitmap version and used for special cases, like thumbnail poster. You'd better not play it on `SDAnimatedImageView`. Because Lottie is a vector animation and `Lottie.AnimationView` use Core Animation for rendering, which is faster.
115 |
116 | ## Demo
117 |
118 | 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.
119 |
120 | ```bash
121 | cd Example/
122 | pod install
123 | open SDWebImageLottiePlugin.xcworkspace
124 | ```
125 |
126 | After the Xcode project was opened, click `Run` to build and run the demo.
127 |
128 | ## Screenshot
129 |
130 | + iOS Demo
131 |
132 |
133 |
134 | + macOS Demo
135 |
136 |
137 |
138 | The lottie json files are from [lottie-web example](https://github.com/airbnb/lottie-web)
139 |
140 | ## Author
141 |
142 | DreamPiggy
143 |
144 | ## License
145 |
146 | SDWebImageLottiePlugin is available under the MIT license. See the LICENSE file for more info.
147 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint SDWebImageLottiePlugin.podspec' to ensure this is a
3 | # valid spec before submitting.
4 | #
5 | # Any lines starting with a # are optional, but their use is encouraged
6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
7 | #
8 |
9 | Pod::Spec.new do |s|
10 | s.name = 'SDWebImageLottiePlugin'
11 | s.version = '1.0.0'
12 | s.summary = 'SDWebImage integration with Lottie Animation using remote JSON files'
13 |
14 | s.description = <<-DESC
15 | SDWebImageLottiePlugin is a plugin for SDWebImage framework, which provide the Lottie animation loading from JSON file.
16 | DESC
17 |
18 | s.homepage = 'https://github.com/SDWebImage/SDWebImageLottiePlugin'
19 | s.license = { :type => 'MIT', :file => 'LICENSE' }
20 | s.author = { 'DreamPiggy' => 'lizhuoli1126@126.com' }
21 | s.source = { :git => 'https://github.com/SDWebImage/SDWebImageLottiePlugin.git', :tag => s.version.to_s }
22 |
23 | s.ios.deployment_target = '11.0'
24 | s.osx.deployment_target = '10.11'
25 | s.tvos.deployment_target = '11.0'
26 |
27 | s.source_files = 'SDWebImageLottiePlugin/Classes/**/*'
28 | s.swift_version = '5'
29 |
30 | s.pod_target_xcconfig = {
31 | 'SUPPORTS_MACCATALYST' => 'YES',
32 | 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES',
33 | 'DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER' => 'NO',
34 | 'OTHER_SWIFT_FLAGS' => '$(inherited) -Xfrontend -disable-testable-attr-requires-testable-module'
35 | }
36 |
37 | s.dependency 'SDWebImage', '~> 5.10'
38 | s.dependency 'lottie-ios', '~> 3.4'
39 | end
40 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 3249A527240A58C800AB1888 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3249A526240A58C800AB1888 /* SDWebImage.framework */; };
11 | 3249A52B240A58D100AB1888 /* Lottie.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3249A52A240A58D100AB1888 /* Lottie.framework */; };
12 | 3249A52E240A58E000AB1888 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3249A52D240A58E000AB1888 /* SDWebImage.framework */; };
13 | 3249A532240A58EA00AB1888 /* Lottie.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3249A531240A58EA00AB1888 /* Lottie.framework */; };
14 | 3249A535240A58FB00AB1888 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3249A534240A58FB00AB1888 /* SDWebImage.framework */; };
15 | 3249A539240A590600AB1888 /* Lottie.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3249A538240A590600AB1888 /* Lottie.framework */; };
16 | 32FBF6922878941700A0FA93 /* LottieImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF68C2878941700A0FA93 /* LottieImage.swift */; };
17 | 32FBF6932878941700A0FA93 /* LottieImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF68C2878941700A0FA93 /* LottieImage.swift */; };
18 | 32FBF6942878941700A0FA93 /* LottieImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF68C2878941700A0FA93 /* LottieImage.swift */; };
19 | 32FBF6982878941700A0FA93 /* AnimationView+WebCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF68E2878941700A0FA93 /* AnimationView+WebCache.swift */; };
20 | 32FBF6992878941700A0FA93 /* AnimationView+WebCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF68E2878941700A0FA93 /* AnimationView+WebCache.swift */; };
21 | 32FBF69A2878941700A0FA93 /* AnimationView+WebCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF68E2878941700A0FA93 /* AnimationView+WebCache.swift */; };
22 | 32FBF69E2878941700A0FA93 /* AnimatedControl+WebCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF6902878941700A0FA93 /* AnimatedControl+WebCache.swift */; };
23 | 32FBF69F2878941700A0FA93 /* AnimatedControl+WebCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF6902878941700A0FA93 /* AnimatedControl+WebCache.swift */; };
24 | 32FBF6A02878941700A0FA93 /* AnimatedControl+WebCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF6902878941700A0FA93 /* AnimatedControl+WebCache.swift */; };
25 | 32FBF6A12878941700A0FA93 /* LottieCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF6912878941700A0FA93 /* LottieCompositionLayer.swift */; };
26 | 32FBF6A22878941700A0FA93 /* LottieCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF6912878941700A0FA93 /* LottieCompositionLayer.swift */; };
27 | 32FBF6A32878941700A0FA93 /* LottieCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FBF6912878941700A0FA93 /* LottieCompositionLayer.swift */; };
28 | /* End PBXBuildFile section */
29 |
30 | /* Begin PBXFileReference section */
31 | 3249A4ED240A54FB00AB1888 /* SDWebImageLottiePlugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImageLottiePlugin.framework; sourceTree = BUILT_PRODUCTS_DIR; };
32 | 3249A4F1240A54FB00AB1888 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Module/Info.plist; sourceTree = ""; };
33 | 3249A508240A562B00AB1888 /* SDWebImageLottiePlugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImageLottiePlugin.framework; sourceTree = BUILT_PRODUCTS_DIR; };
34 | 3249A515240A563500AB1888 /* SDWebImageLottiePlugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImageLottiePlugin.framework; sourceTree = BUILT_PRODUCTS_DIR; };
35 | 3249A526240A58C800AB1888 /* SDWebImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDWebImage.framework; path = Carthage/Build/iOS/SDWebImage.framework; sourceTree = ""; };
36 | 3249A52A240A58D100AB1888 /* Lottie.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Lottie.framework; path = Carthage/Build/iOS/Lottie.framework; sourceTree = ""; };
37 | 3249A52D240A58E000AB1888 /* SDWebImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDWebImage.framework; path = Carthage/Build/tvOS/SDWebImage.framework; sourceTree = ""; };
38 | 3249A531240A58EA00AB1888 /* Lottie.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Lottie.framework; path = Carthage/Build/tvOS/Lottie.framework; sourceTree = ""; };
39 | 3249A534240A58FB00AB1888 /* SDWebImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDWebImage.framework; path = Carthage/Build/Mac/SDWebImage.framework; sourceTree = ""; };
40 | 3249A538240A590600AB1888 /* Lottie.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Lottie.framework; path = Carthage/Build/Mac/Lottie.framework; sourceTree = ""; };
41 | 32FBF68C2878941700A0FA93 /* LottieImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LottieImage.swift; sourceTree = ""; };
42 | 32FBF68E2878941700A0FA93 /* AnimationView+WebCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AnimationView+WebCache.swift"; sourceTree = ""; };
43 | 32FBF6902878941700A0FA93 /* AnimatedControl+WebCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AnimatedControl+WebCache.swift"; sourceTree = ""; };
44 | 32FBF6912878941700A0FA93 /* LottieCompositionLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LottieCompositionLayer.swift; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 3249A4EA240A54FB00AB1888 /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | 3249A527240A58C800AB1888 /* SDWebImage.framework in Frameworks */,
53 | 3249A52B240A58D100AB1888 /* Lottie.framework in Frameworks */,
54 | );
55 | runOnlyForDeploymentPostprocessing = 0;
56 | };
57 | 3249A505240A562B00AB1888 /* Frameworks */ = {
58 | isa = PBXFrameworksBuildPhase;
59 | buildActionMask = 2147483647;
60 | files = (
61 | 3249A52E240A58E000AB1888 /* SDWebImage.framework in Frameworks */,
62 | 3249A532240A58EA00AB1888 /* Lottie.framework in Frameworks */,
63 | );
64 | runOnlyForDeploymentPostprocessing = 0;
65 | };
66 | 3249A512240A563500AB1888 /* Frameworks */ = {
67 | isa = PBXFrameworksBuildPhase;
68 | buildActionMask = 2147483647;
69 | files = (
70 | 3249A535240A58FB00AB1888 /* SDWebImage.framework in Frameworks */,
71 | 3249A539240A590600AB1888 /* Lottie.framework in Frameworks */,
72 | );
73 | runOnlyForDeploymentPostprocessing = 0;
74 | };
75 | /* End PBXFrameworksBuildPhase section */
76 |
77 | /* Begin PBXGroup section */
78 | 3249A4E3240A54FB00AB1888 = {
79 | isa = PBXGroup;
80 | children = (
81 | 3249A4EF240A54FB00AB1888 /* SDWebImageLottiePlugin */,
82 | 3249A4EE240A54FB00AB1888 /* Products */,
83 | 3249A525240A58C800AB1888 /* Frameworks */,
84 | );
85 | sourceTree = "";
86 | };
87 | 3249A4EE240A54FB00AB1888 /* Products */ = {
88 | isa = PBXGroup;
89 | children = (
90 | 3249A4ED240A54FB00AB1888 /* SDWebImageLottiePlugin.framework */,
91 | 3249A508240A562B00AB1888 /* SDWebImageLottiePlugin.framework */,
92 | 3249A515240A563500AB1888 /* SDWebImageLottiePlugin.framework */,
93 | );
94 | name = Products;
95 | sourceTree = "";
96 | };
97 | 3249A4EF240A54FB00AB1888 /* SDWebImageLottiePlugin */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 32FBF68B2878941700A0FA93 /* Classes */,
101 | 3249A4F1240A54FB00AB1888 /* Info.plist */,
102 | );
103 | path = SDWebImageLottiePlugin;
104 | sourceTree = "";
105 | };
106 | 3249A525240A58C800AB1888 /* Frameworks */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 3249A538240A590600AB1888 /* Lottie.framework */,
110 | 3249A534240A58FB00AB1888 /* SDWebImage.framework */,
111 | 3249A531240A58EA00AB1888 /* Lottie.framework */,
112 | 3249A52D240A58E000AB1888 /* SDWebImage.framework */,
113 | 3249A52A240A58D100AB1888 /* Lottie.framework */,
114 | 3249A526240A58C800AB1888 /* SDWebImage.framework */,
115 | );
116 | name = Frameworks;
117 | sourceTree = "";
118 | };
119 | 32FBF68B2878941700A0FA93 /* Classes */ = {
120 | isa = PBXGroup;
121 | children = (
122 | 32FBF68C2878941700A0FA93 /* LottieImage.swift */,
123 | 32FBF68E2878941700A0FA93 /* AnimationView+WebCache.swift */,
124 | 32FBF6902878941700A0FA93 /* AnimatedControl+WebCache.swift */,
125 | 32FBF6912878941700A0FA93 /* LottieCompositionLayer.swift */,
126 | );
127 | path = Classes;
128 | sourceTree = "";
129 | };
130 | /* End PBXGroup section */
131 |
132 | /* Begin PBXHeadersBuildPhase section */
133 | 3249A4E8240A54FB00AB1888 /* Headers */ = {
134 | isa = PBXHeadersBuildPhase;
135 | buildActionMask = 2147483647;
136 | files = (
137 | );
138 | runOnlyForDeploymentPostprocessing = 0;
139 | };
140 | 3249A503240A562B00AB1888 /* Headers */ = {
141 | isa = PBXHeadersBuildPhase;
142 | buildActionMask = 2147483647;
143 | files = (
144 | );
145 | runOnlyForDeploymentPostprocessing = 0;
146 | };
147 | 3249A510240A563500AB1888 /* Headers */ = {
148 | isa = PBXHeadersBuildPhase;
149 | buildActionMask = 2147483647;
150 | files = (
151 | );
152 | runOnlyForDeploymentPostprocessing = 0;
153 | };
154 | /* End PBXHeadersBuildPhase section */
155 |
156 | /* Begin PBXNativeTarget section */
157 | 3249A4EC240A54FB00AB1888 /* SDWebImageLottiePlugin */ = {
158 | isa = PBXNativeTarget;
159 | buildConfigurationList = 3249A4F5240A54FB00AB1888 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin" */;
160 | buildPhases = (
161 | 3249A4E8240A54FB00AB1888 /* Headers */,
162 | 3249A4E9240A54FB00AB1888 /* Sources */,
163 | 3249A4EA240A54FB00AB1888 /* Frameworks */,
164 | 3249A4EB240A54FB00AB1888 /* Resources */,
165 | );
166 | buildRules = (
167 | );
168 | dependencies = (
169 | );
170 | name = SDWebImageLottiePlugin;
171 | productName = SDWebImageLottiePlugin;
172 | productReference = 3249A4ED240A54FB00AB1888 /* SDWebImageLottiePlugin.framework */;
173 | productType = "com.apple.product-type.framework";
174 | };
175 | 3249A507240A562B00AB1888 /* SDWebImageLottiePlugin tvOS */ = {
176 | isa = PBXNativeTarget;
177 | buildConfigurationList = 3249A50F240A562B00AB1888 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin tvOS" */;
178 | buildPhases = (
179 | 3249A503240A562B00AB1888 /* Headers */,
180 | 3249A504240A562B00AB1888 /* Sources */,
181 | 3249A505240A562B00AB1888 /* Frameworks */,
182 | 3249A506240A562B00AB1888 /* Resources */,
183 | );
184 | buildRules = (
185 | );
186 | dependencies = (
187 | );
188 | name = "SDWebImageLottiePlugin tvOS";
189 | productName = "SDWebImageLottiePlugin tvOS";
190 | productReference = 3249A508240A562B00AB1888 /* SDWebImageLottiePlugin.framework */;
191 | productType = "com.apple.product-type.framework";
192 | };
193 | 3249A514240A563500AB1888 /* SDWebImageLottiePlugin macOS */ = {
194 | isa = PBXNativeTarget;
195 | buildConfigurationList = 3249A51A240A563500AB1888 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin macOS" */;
196 | buildPhases = (
197 | 3249A510240A563500AB1888 /* Headers */,
198 | 3249A511240A563500AB1888 /* Sources */,
199 | 3249A512240A563500AB1888 /* Frameworks */,
200 | 3249A513240A563500AB1888 /* Resources */,
201 | );
202 | buildRules = (
203 | );
204 | dependencies = (
205 | );
206 | name = "SDWebImageLottiePlugin macOS";
207 | productName = "SDWebImageLottiePlugin macOS";
208 | productReference = 3249A515240A563500AB1888 /* SDWebImageLottiePlugin.framework */;
209 | productType = "com.apple.product-type.framework";
210 | };
211 | /* End PBXNativeTarget section */
212 |
213 | /* Begin PBXProject section */
214 | 3249A4E4240A54FB00AB1888 /* Project object */ = {
215 | isa = PBXProject;
216 | attributes = {
217 | LastUpgradeCheck = 1130;
218 | ORGANIZATIONNAME = cocoapods;
219 | TargetAttributes = {
220 | 3249A4EC240A54FB00AB1888 = {
221 | CreatedOnToolsVersion = 11.3.1;
222 | };
223 | 3249A507240A562B00AB1888 = {
224 | CreatedOnToolsVersion = 11.3.1;
225 | };
226 | 3249A514240A563500AB1888 = {
227 | CreatedOnToolsVersion = 11.3.1;
228 | };
229 | };
230 | };
231 | buildConfigurationList = 3249A4E7240A54FB00AB1888 /* Build configuration list for PBXProject "SDWebImageLottiePlugin" */;
232 | compatibilityVersion = "Xcode 9.3";
233 | developmentRegion = en;
234 | hasScannedForEncodings = 0;
235 | knownRegions = (
236 | en,
237 | Base,
238 | );
239 | mainGroup = 3249A4E3240A54FB00AB1888;
240 | productRefGroup = 3249A4EE240A54FB00AB1888 /* Products */;
241 | projectDirPath = "";
242 | projectRoot = "";
243 | targets = (
244 | 3249A4EC240A54FB00AB1888 /* SDWebImageLottiePlugin */,
245 | 3249A507240A562B00AB1888 /* SDWebImageLottiePlugin tvOS */,
246 | 3249A514240A563500AB1888 /* SDWebImageLottiePlugin macOS */,
247 | );
248 | };
249 | /* End PBXProject section */
250 |
251 | /* Begin PBXResourcesBuildPhase section */
252 | 3249A4EB240A54FB00AB1888 /* Resources */ = {
253 | isa = PBXResourcesBuildPhase;
254 | buildActionMask = 2147483647;
255 | files = (
256 | );
257 | runOnlyForDeploymentPostprocessing = 0;
258 | };
259 | 3249A506240A562B00AB1888 /* Resources */ = {
260 | isa = PBXResourcesBuildPhase;
261 | buildActionMask = 2147483647;
262 | files = (
263 | );
264 | runOnlyForDeploymentPostprocessing = 0;
265 | };
266 | 3249A513240A563500AB1888 /* Resources */ = {
267 | isa = PBXResourcesBuildPhase;
268 | buildActionMask = 2147483647;
269 | files = (
270 | );
271 | runOnlyForDeploymentPostprocessing = 0;
272 | };
273 | /* End PBXResourcesBuildPhase section */
274 |
275 | /* Begin PBXSourcesBuildPhase section */
276 | 3249A4E9240A54FB00AB1888 /* Sources */ = {
277 | isa = PBXSourcesBuildPhase;
278 | buildActionMask = 2147483647;
279 | files = (
280 | 32FBF6922878941700A0FA93 /* LottieImage.swift in Sources */,
281 | 32FBF69E2878941700A0FA93 /* AnimatedControl+WebCache.swift in Sources */,
282 | 32FBF6A12878941700A0FA93 /* LottieCompositionLayer.swift in Sources */,
283 | 32FBF6982878941700A0FA93 /* AnimationView+WebCache.swift in Sources */,
284 | );
285 | runOnlyForDeploymentPostprocessing = 0;
286 | };
287 | 3249A504240A562B00AB1888 /* Sources */ = {
288 | isa = PBXSourcesBuildPhase;
289 | buildActionMask = 2147483647;
290 | files = (
291 | 32FBF6932878941700A0FA93 /* LottieImage.swift in Sources */,
292 | 32FBF69F2878941700A0FA93 /* AnimatedControl+WebCache.swift in Sources */,
293 | 32FBF6A22878941700A0FA93 /* LottieCompositionLayer.swift in Sources */,
294 | 32FBF6992878941700A0FA93 /* AnimationView+WebCache.swift in Sources */,
295 | );
296 | runOnlyForDeploymentPostprocessing = 0;
297 | };
298 | 3249A511240A563500AB1888 /* Sources */ = {
299 | isa = PBXSourcesBuildPhase;
300 | buildActionMask = 2147483647;
301 | files = (
302 | 32FBF6942878941700A0FA93 /* LottieImage.swift in Sources */,
303 | 32FBF6A02878941700A0FA93 /* AnimatedControl+WebCache.swift in Sources */,
304 | 32FBF6A32878941700A0FA93 /* LottieCompositionLayer.swift in Sources */,
305 | 32FBF69A2878941700A0FA93 /* AnimationView+WebCache.swift in Sources */,
306 | );
307 | runOnlyForDeploymentPostprocessing = 0;
308 | };
309 | /* End PBXSourcesBuildPhase section */
310 |
311 | /* Begin XCBuildConfiguration section */
312 | 3249A4F3240A54FB00AB1888 /* Debug */ = {
313 | isa = XCBuildConfiguration;
314 | buildSettings = {
315 | ALWAYS_SEARCH_USER_PATHS = NO;
316 | CLANG_ANALYZER_NONNULL = YES;
317 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
318 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
319 | CLANG_CXX_LIBRARY = "libc++";
320 | CLANG_ENABLE_MODULES = YES;
321 | CLANG_ENABLE_OBJC_ARC = YES;
322 | CLANG_ENABLE_OBJC_WEAK = YES;
323 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
324 | CLANG_WARN_BOOL_CONVERSION = YES;
325 | CLANG_WARN_COMMA = YES;
326 | CLANG_WARN_CONSTANT_CONVERSION = YES;
327 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
328 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
329 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
330 | CLANG_WARN_EMPTY_BODY = YES;
331 | CLANG_WARN_ENUM_CONVERSION = YES;
332 | CLANG_WARN_INFINITE_RECURSION = YES;
333 | CLANG_WARN_INT_CONVERSION = YES;
334 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
335 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
336 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
338 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
339 | CLANG_WARN_STRICT_PROTOTYPES = YES;
340 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
341 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
342 | CLANG_WARN_UNREACHABLE_CODE = YES;
343 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
344 | COPY_PHASE_STRIP = NO;
345 | CURRENT_PROJECT_VERSION = 1;
346 | DEBUG_INFORMATION_FORMAT = dwarf;
347 | ENABLE_STRICT_OBJC_MSGSEND = YES;
348 | ENABLE_TESTABILITY = YES;
349 | GCC_C_LANGUAGE_STANDARD = gnu11;
350 | GCC_DYNAMIC_NO_PIC = NO;
351 | GCC_NO_COMMON_BLOCKS = YES;
352 | GCC_OPTIMIZATION_LEVEL = 0;
353 | GCC_PREPROCESSOR_DEFINITIONS = (
354 | "DEBUG=1",
355 | "$(inherited)",
356 | );
357 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
358 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
359 | GCC_WARN_UNDECLARED_SELECTOR = YES;
360 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
361 | GCC_WARN_UNUSED_FUNCTION = YES;
362 | GCC_WARN_UNUSED_VARIABLE = YES;
363 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
364 | MACOSX_DEPLOYMENT_TARGET = 10.11;
365 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
366 | MTL_FAST_MATH = YES;
367 | ONLY_ACTIVE_ARCH = YES;
368 | OTHER_SWIFT_FLAGS = "-Xfrontend -disable-testable-attr-requires-testable-module";
369 | SDKROOT = iphoneos;
370 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
371 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
372 | TVOS_DEPLOYMENT_TARGET = 11.0;
373 | VERSIONING_SYSTEM = "apple-generic";
374 | VERSION_INFO_PREFIX = "";
375 | WATCHOS_DEPLOYMENT_TARGET = 2.0;
376 | };
377 | name = Debug;
378 | };
379 | 3249A4F4240A54FB00AB1888 /* Release */ = {
380 | isa = XCBuildConfiguration;
381 | buildSettings = {
382 | ALWAYS_SEARCH_USER_PATHS = NO;
383 | CLANG_ANALYZER_NONNULL = YES;
384 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
385 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
386 | CLANG_CXX_LIBRARY = "libc++";
387 | CLANG_ENABLE_MODULES = YES;
388 | CLANG_ENABLE_OBJC_ARC = YES;
389 | CLANG_ENABLE_OBJC_WEAK = YES;
390 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
391 | CLANG_WARN_BOOL_CONVERSION = YES;
392 | CLANG_WARN_COMMA = YES;
393 | CLANG_WARN_CONSTANT_CONVERSION = YES;
394 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
395 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
396 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
397 | CLANG_WARN_EMPTY_BODY = YES;
398 | CLANG_WARN_ENUM_CONVERSION = YES;
399 | CLANG_WARN_INFINITE_RECURSION = YES;
400 | CLANG_WARN_INT_CONVERSION = YES;
401 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
402 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
403 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
405 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
406 | CLANG_WARN_STRICT_PROTOTYPES = YES;
407 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
408 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
409 | CLANG_WARN_UNREACHABLE_CODE = YES;
410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
411 | COPY_PHASE_STRIP = NO;
412 | CURRENT_PROJECT_VERSION = 1;
413 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
414 | ENABLE_NS_ASSERTIONS = NO;
415 | ENABLE_STRICT_OBJC_MSGSEND = YES;
416 | GCC_C_LANGUAGE_STANDARD = gnu11;
417 | GCC_NO_COMMON_BLOCKS = YES;
418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
420 | GCC_WARN_UNDECLARED_SELECTOR = YES;
421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
422 | GCC_WARN_UNUSED_FUNCTION = YES;
423 | GCC_WARN_UNUSED_VARIABLE = YES;
424 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
425 | MACOSX_DEPLOYMENT_TARGET = 10.11;
426 | MTL_ENABLE_DEBUG_INFO = NO;
427 | MTL_FAST_MATH = YES;
428 | OTHER_SWIFT_FLAGS = "-Xfrontend -disable-testable-attr-requires-testable-module";
429 | SDKROOT = iphoneos;
430 | SWIFT_COMPILATION_MODE = wholemodule;
431 | SWIFT_OPTIMIZATION_LEVEL = "-O";
432 | TVOS_DEPLOYMENT_TARGET = 11.0;
433 | VALIDATE_PRODUCT = YES;
434 | VERSIONING_SYSTEM = "apple-generic";
435 | VERSION_INFO_PREFIX = "";
436 | WATCHOS_DEPLOYMENT_TARGET = 2.0;
437 | };
438 | name = Release;
439 | };
440 | 3249A4F6240A54FB00AB1888 /* Debug */ = {
441 | isa = XCBuildConfiguration;
442 | buildSettings = {
443 | CODE_SIGN_STYLE = Automatic;
444 | DEFINES_MODULE = YES;
445 | DYLIB_COMPATIBILITY_VERSION = 1;
446 | DYLIB_CURRENT_VERSION = 1;
447 | DYLIB_INSTALL_NAME_BASE = "@rpath";
448 | FRAMEWORK_SEARCH_PATHS = (
449 | "$(inherited)",
450 | "$(PROJECT_DIR)/Carthage/Build/iOS",
451 | );
452 | INFOPLIST_FILE = "$(SRCROOT)/SDWebImageLottiePlugin/Module/Info.plist";
453 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
454 | LD_RUNPATH_SEARCH_PATHS = (
455 | "$(inherited)",
456 | "@executable_path/Frameworks",
457 | "@loader_path/Frameworks",
458 | );
459 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.SDWebImageLottiePlugin;
460 | PRODUCT_NAME = SDWebImageLottiePlugin;
461 | SKIP_INSTALL = YES;
462 | SWIFT_VERSION = 5.0;
463 | TARGETED_DEVICE_FAMILY = "1,2";
464 | };
465 | name = Debug;
466 | };
467 | 3249A4F7240A54FB00AB1888 /* Release */ = {
468 | isa = XCBuildConfiguration;
469 | buildSettings = {
470 | CODE_SIGN_STYLE = Automatic;
471 | DEFINES_MODULE = YES;
472 | DYLIB_COMPATIBILITY_VERSION = 1;
473 | DYLIB_CURRENT_VERSION = 1;
474 | DYLIB_INSTALL_NAME_BASE = "@rpath";
475 | FRAMEWORK_SEARCH_PATHS = (
476 | "$(inherited)",
477 | "$(PROJECT_DIR)/Carthage/Build/iOS",
478 | );
479 | INFOPLIST_FILE = "$(SRCROOT)/SDWebImageLottiePlugin/Module/Info.plist";
480 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
481 | LD_RUNPATH_SEARCH_PATHS = (
482 | "$(inherited)",
483 | "@executable_path/Frameworks",
484 | "@loader_path/Frameworks",
485 | );
486 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.SDWebImageLottiePlugin;
487 | PRODUCT_NAME = SDWebImageLottiePlugin;
488 | SKIP_INSTALL = YES;
489 | SWIFT_VERSION = 5.0;
490 | TARGETED_DEVICE_FAMILY = "1,2";
491 | };
492 | name = Release;
493 | };
494 | 3249A50D240A562B00AB1888 /* Debug */ = {
495 | isa = XCBuildConfiguration;
496 | buildSettings = {
497 | CODE_SIGN_STYLE = Automatic;
498 | DEFINES_MODULE = YES;
499 | DYLIB_COMPATIBILITY_VERSION = 1;
500 | DYLIB_CURRENT_VERSION = 1;
501 | DYLIB_INSTALL_NAME_BASE = "@rpath";
502 | FRAMEWORK_SEARCH_PATHS = (
503 | "$(inherited)",
504 | "$(PROJECT_DIR)/Carthage/Build/tvOS",
505 | );
506 | INFOPLIST_FILE = "$(SRCROOT)/SDWebImageLottiePlugin/Module/Info.plist";
507 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
508 | LD_RUNPATH_SEARCH_PATHS = (
509 | "$(inherited)",
510 | "@executable_path/Frameworks",
511 | "@loader_path/Frameworks",
512 | );
513 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SDWebImageLottiePlugin-tvOS";
514 | PRODUCT_NAME = SDWebImageLottiePlugin;
515 | SDKROOT = appletvos;
516 | SKIP_INSTALL = YES;
517 | SWIFT_VERSION = 5.0;
518 | TARGETED_DEVICE_FAMILY = 3;
519 | };
520 | name = Debug;
521 | };
522 | 3249A50E240A562B00AB1888 /* Release */ = {
523 | isa = XCBuildConfiguration;
524 | buildSettings = {
525 | CODE_SIGN_STYLE = Automatic;
526 | DEFINES_MODULE = YES;
527 | DYLIB_COMPATIBILITY_VERSION = 1;
528 | DYLIB_CURRENT_VERSION = 1;
529 | DYLIB_INSTALL_NAME_BASE = "@rpath";
530 | FRAMEWORK_SEARCH_PATHS = (
531 | "$(inherited)",
532 | "$(PROJECT_DIR)/Carthage/Build/tvOS",
533 | );
534 | INFOPLIST_FILE = "$(SRCROOT)/SDWebImageLottiePlugin/Module/Info.plist";
535 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
536 | LD_RUNPATH_SEARCH_PATHS = (
537 | "$(inherited)",
538 | "@executable_path/Frameworks",
539 | "@loader_path/Frameworks",
540 | );
541 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SDWebImageLottiePlugin-tvOS";
542 | PRODUCT_NAME = SDWebImageLottiePlugin;
543 | SDKROOT = appletvos;
544 | SKIP_INSTALL = YES;
545 | SWIFT_VERSION = 5.0;
546 | TARGETED_DEVICE_FAMILY = 3;
547 | };
548 | name = Release;
549 | };
550 | 3249A51B240A563500AB1888 /* Debug */ = {
551 | isa = XCBuildConfiguration;
552 | buildSettings = {
553 | CODE_SIGN_STYLE = Automatic;
554 | COMBINE_HIDPI_IMAGES = YES;
555 | DEFINES_MODULE = YES;
556 | DYLIB_COMPATIBILITY_VERSION = 1;
557 | DYLIB_CURRENT_VERSION = 1;
558 | DYLIB_INSTALL_NAME_BASE = "@rpath";
559 | FRAMEWORK_SEARCH_PATHS = (
560 | "$(inherited)",
561 | "$(PROJECT_DIR)/Carthage/Build/Mac",
562 | );
563 | INFOPLIST_FILE = "$(SRCROOT)/SDWebImageLottiePlugin/Module/Info.plist";
564 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
565 | LD_RUNPATH_SEARCH_PATHS = (
566 | "$(inherited)",
567 | "@executable_path/../Frameworks",
568 | "@loader_path/Frameworks",
569 | );
570 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SDWebImageLottiePlugin-macOS";
571 | PRODUCT_NAME = SDWebImageLottiePlugin;
572 | SDKROOT = macosx;
573 | SKIP_INSTALL = YES;
574 | SWIFT_VERSION = 5.0;
575 | };
576 | name = Debug;
577 | };
578 | 3249A51C240A563500AB1888 /* Release */ = {
579 | isa = XCBuildConfiguration;
580 | buildSettings = {
581 | CODE_SIGN_STYLE = Automatic;
582 | COMBINE_HIDPI_IMAGES = YES;
583 | DEFINES_MODULE = YES;
584 | DYLIB_COMPATIBILITY_VERSION = 1;
585 | DYLIB_CURRENT_VERSION = 1;
586 | DYLIB_INSTALL_NAME_BASE = "@rpath";
587 | FRAMEWORK_SEARCH_PATHS = (
588 | "$(inherited)",
589 | "$(PROJECT_DIR)/Carthage/Build/Mac",
590 | );
591 | INFOPLIST_FILE = "$(SRCROOT)/SDWebImageLottiePlugin/Module/Info.plist";
592 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
593 | LD_RUNPATH_SEARCH_PATHS = (
594 | "$(inherited)",
595 | "@executable_path/../Frameworks",
596 | "@loader_path/Frameworks",
597 | );
598 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SDWebImageLottiePlugin-macOS";
599 | PRODUCT_NAME = SDWebImageLottiePlugin;
600 | SDKROOT = macosx;
601 | SKIP_INSTALL = YES;
602 | SWIFT_VERSION = 5.0;
603 | };
604 | name = Release;
605 | };
606 | /* End XCBuildConfiguration section */
607 |
608 | /* Begin XCConfigurationList section */
609 | 3249A4E7240A54FB00AB1888 /* Build configuration list for PBXProject "SDWebImageLottiePlugin" */ = {
610 | isa = XCConfigurationList;
611 | buildConfigurations = (
612 | 3249A4F3240A54FB00AB1888 /* Debug */,
613 | 3249A4F4240A54FB00AB1888 /* Release */,
614 | );
615 | defaultConfigurationIsVisible = 0;
616 | defaultConfigurationName = Release;
617 | };
618 | 3249A4F5240A54FB00AB1888 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin" */ = {
619 | isa = XCConfigurationList;
620 | buildConfigurations = (
621 | 3249A4F6240A54FB00AB1888 /* Debug */,
622 | 3249A4F7240A54FB00AB1888 /* Release */,
623 | );
624 | defaultConfigurationIsVisible = 0;
625 | defaultConfigurationName = Release;
626 | };
627 | 3249A50F240A562B00AB1888 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin tvOS" */ = {
628 | isa = XCConfigurationList;
629 | buildConfigurations = (
630 | 3249A50D240A562B00AB1888 /* Debug */,
631 | 3249A50E240A562B00AB1888 /* Release */,
632 | );
633 | defaultConfigurationIsVisible = 0;
634 | defaultConfigurationName = Release;
635 | };
636 | 3249A51A240A563500AB1888 /* Build configuration list for PBXNativeTarget "SDWebImageLottiePlugin macOS" */ = {
637 | isa = XCConfigurationList;
638 | buildConfigurations = (
639 | 3249A51B240A563500AB1888 /* Debug */,
640 | 3249A51C240A563500AB1888 /* Release */,
641 | );
642 | defaultConfigurationIsVisible = 0;
643 | defaultConfigurationName = Release;
644 | };
645 | /* End XCConfigurationList section */
646 | };
647 | rootObject = 3249A4E4240A54FB00AB1888 /* Project object */;
648 | }
649 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin.xcodeproj/xcshareddata/xcschemes/SDWebImageLottiePlugin macOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
57 |
58 |
59 |
60 |
62 |
63 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin.xcodeproj/xcshareddata/xcschemes/SDWebImageLottiePlugin tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
57 |
58 |
59 |
60 |
62 |
63 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin.xcodeproj/xcshareddata/xcschemes/SDWebImageLottiePlugin.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
57 |
58 |
59 |
60 |
62 |
63 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SDWebImage/SDWebImageLottiePlugin/d4ae63250f856cb382ecf80f14df12e78e9e0f0b/SDWebImageLottiePlugin/Assets/.gitkeep
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SDWebImage/SDWebImageLottiePlugin/d4ae63250f856cb382ecf80f14df12e78e9e0f0b/SDWebImageLottiePlugin/Classes/.gitkeep
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin/Classes/AnimatedControl+WebCache.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) DreamPiggy
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | import SDWebImage
10 | import Lottie
11 |
12 | #if os(iOS) || os(tvOS)
13 | extension AnimatedControl {
14 | /**
15 | * Set the imageView `image` with an `url`, placeholder, custom options and context.
16 | *
17 | * The download is asynchronous and cached.
18 | *
19 | * @param url The url for the image.
20 | * @param placeholder The image to be set initially, until the image request finishes.
21 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
22 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
23 | * @param progressBlock A block called while image is downloading
24 | * @note the progress block is executed on a background queue
25 | * @param completedBlock A block called when operation has been completed. This block has no return value
26 | * and takes the requested UIImage as first parameter. In case of error the image parameter
27 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
28 | * indicating if the image was retrieved from the local cache or from the network.
29 | * The fourth parameter is the original image url.
30 | */
31 | public func sd_setImage(with url: URL?, placeholderImage placeholder: UIImage? = nil, options: SDWebImageOptions = [], context: [SDWebImageContextOption : Any]? = nil, progress progressBlock: SDImageLoaderProgressBlock? = nil, completed completedBlock: SDExternalCompletionBlock? = nil) {
32 | var context = context ?? [:]
33 | context[.animatedImageClass] = LottieImage.self
34 | self.sd_internalSetImage(with: url, placeholderImage: placeholder, options: options, context: context, setImageBlock: { [weak self] (image, data, cacheType, url) in
35 | if let lottieImage = image as? LottieImage {
36 | self?.animation = lottieImage.animation
37 | } else {
38 | self?.animation = nil
39 | }
40 | }, progress: progressBlock) { (image, data, error, cacheType, finiseh, url) in
41 | completedBlock?(image, error, cacheType, url)
42 | }
43 | }
44 | }
45 | #endif
46 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin/Classes/AnimationView+WebCache.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) DreamPiggy
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | import SDWebImage
10 | import Lottie
11 |
12 | extension AnimationView {
13 | /**
14 | * Set the imageView `image` with an `url`, placeholder, custom options and context.
15 | *
16 | * The download is asynchronous and cached.
17 | *
18 | * @param url The url for the image.
19 | * @param placeholder The image to be set initially, until the image request finishes.
20 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
21 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
22 | * @param progressBlock A block called while image is downloading
23 | * @note the progress block is executed on a background queue
24 | * @param completedBlock A block called when operation has been completed. This block has no return value
25 | * and takes the requested UIImage as first parameter. In case of error the image parameter
26 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
27 | * indicating if the image was retrieved from the local cache or from the network.
28 | * The fourth parameter is the original image url.
29 | */
30 | public func sd_setImage(with url: URL?, placeholderImage placeholder: PlatformImage? = nil, options: SDWebImageOptions = [], context: [SDWebImageContextOption : Any]? = nil, progress progressBlock: SDImageLoaderProgressBlock? = nil, completed completedBlock: SDExternalCompletionBlock? = nil) {
31 | var context = context ?? [:]
32 | context[.animatedImageClass] = LottieImage.self
33 | self.sd_internalSetImage(with: url, placeholderImage: placeholder, options: options, context: context, setImageBlock: { [weak self] (image, data, cacheType, url) in
34 | if let lottieImage = image as? LottieImage {
35 | self?.animation = lottieImage.animation
36 | } else {
37 | self?.animation = nil
38 | }
39 | }, progress: progressBlock) { (image, data, error, cacheType, finiseh, url) in
40 | completedBlock?(image, error, cacheType, url)
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin/Classes/LottieCompositionLayer.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) DreamPiggy
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | import SDWebImage
10 | @testable import Lottie
11 |
12 | /// This layer is used like Lottie 2's`LOTCompositionContainer`. Typically private, use with caution :)
13 | /// Which can render the specify frame into CGBitmapContext by calling `layer.render(in:)`, used for debugging or some snapshot use case
14 | public class LottieCompositionLayer : CALayer {
15 |
16 | /// All composition sublayers, in hierarchy (reverse order) unlike `sublayers`
17 | private var animationLayers: [CompositionLayer] = []
18 |
19 | /// Initializes an LottieCompositionLayer with an animation.
20 | /// - Parameters:
21 | /// - animation: animation
22 | /// - imageProvider: imageProvider
23 | /// - textProvider: textProvider
24 | /// - fontProvider: fontProvider
25 | public init(animation: Animation,
26 | imageProvider: AnimationImageProvider? = nil,
27 | textProvider: AnimationTextProvider? = nil,
28 | fontProvider: AnimationFontProvider? = nil) {
29 | // Steal from MainThreadAnimationLayer.swift
30 | let layerImageProvider = LayerImageProvider(imageProvider: (imageProvider ?? BundleImageProvider(bundle: .main, searchPath: nil)).cachedImageProvider, assets: animation.assetLibrary?.imageAssets)
31 | let layerTextProvider = LayerTextProvider(textProvider: textProvider ?? DefaultTextProvider())
32 | let layerFontProvider = LayerFontProvider(fontProvider: fontProvider ?? DefaultFontProvider())
33 |
34 | let layers = animation.layers.initializeCompositionLayers(assetLibrary: animation.assetLibrary, layerImageProvider: layerImageProvider, textProvider: layerTextProvider.textProvider, fontProvider: layerFontProvider.fontProvider, frameRate: CGFloat(animation.framerate))
35 | super.init()
36 | bounds = animation.bounds
37 |
38 | var imageLayers = [ImageCompositionLayer]()
39 | var textLayers = [TextCompositionLayer]()
40 |
41 | for layer in layers.reversed() {
42 | layer.bounds = bounds
43 | animationLayers.append(layer)
44 | if let imageLayer = layer as? ImageCompositionLayer {
45 | imageLayers.append(imageLayer)
46 | }
47 | if let textLayer = layer as? TextCompositionLayer {
48 | textLayers.append(textLayer)
49 | }
50 | addSublayer(layer)
51 | }
52 |
53 | layerImageProvider.addImageLayers(imageLayers)
54 | layerImageProvider.reloadImages()
55 | layerTextProvider.addTextLayers(textLayers)
56 | layerTextProvider.reloadTexts()
57 | layerFontProvider.addTextLayers(textLayers)
58 | layerFontProvider.reloadTexts()
59 | }
60 |
61 | required init?(coder: NSCoder) {
62 | fatalError("init(coder:) has not been implemented")
63 | }
64 |
65 | /// Display the layer tree to specify frame time, then call `render(in:)` to draw on CGBitmapContext
66 | /// - Parameters:
67 | /// - frame: The AnimationFrameTime(Seconds * Framerate)
68 | /// - forceUpdates: Whether to force update the tree node, true need time but more accurate rendering result
69 | public func displayWithFrame(frame: CGFloat, forceUpdates: Bool) {
70 | animationLayers.forEach { $0.displayWithFrame(frame: frame, forceUpdates: forceUpdates) }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin/Classes/LottieImage.swift:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) DreamPiggy
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | import SDWebImage
10 | @testable import Lottie
11 |
12 | #if os(macOS)
13 | public typealias PlatformImage = NSImage
14 | #else
15 | public typealias PlatformImage = UIImage
16 | #endif
17 |
18 | /// Used for Swift when subclassing UIImage, workaround for `required' initializer 'init(imageLiteralResourceName:)' must be provided by subclass of 'UIImage'`
19 | extension PlatformImage {
20 | private convenience init!(failableImageLiteral name: String) {
21 | self.init(named: name)
22 | }
23 |
24 | public convenience init(imageLiteralResourceName name: String) {
25 | self.init(failableImageLiteral: name)
26 | }
27 | }
28 |
29 | /// A UIImage subclass wrapper for Lottie animation
30 | public class LottieImage : PlatformImage, SDAnimatedImageProtocol {
31 |
32 | /// The lottie animation model
33 | public var animation: Animation?
34 |
35 | /// The lottie image provider, used for frame extracting
36 | public var imageProvider: AnimationImageProvider?
37 |
38 | /// The lottie text provider, used for frame extracting
39 | public var textProvider: AnimationTextProvider?
40 |
41 | /// The lottie font provider, used for frame extracting
42 | public var fontProvider: AnimationFontProvider?
43 |
44 | /// Init the LottieImage with lottie animation model
45 | /// - Parameter animation: animation
46 | public required init(animation: Animation) {
47 | #if os(iOS) || os(tvOS)
48 | super.init()
49 | #else
50 | super.init(size: animation.size)
51 | #endif
52 | self.animation = animation
53 | }
54 |
55 | public required init?(data: Data, scale: CGFloat, options: [SDImageCoderOption : Any]? = nil) {
56 | let animation: Animation
57 | do {
58 | animation = try JSONDecoder().decode(Animation.self, from: data)
59 | } catch let error {
60 | print(error)
61 | return nil
62 | }
63 | #if os(iOS) || os(tvOS)
64 | super.init()
65 | #else
66 | super.init(size: animation.size)
67 | #endif
68 | self.animation = animation
69 | self.animatedImageData = data
70 | }
71 |
72 | #if os(iOS) || os(tvOS)
73 | public override var size: CGSize {
74 | if let animation = animation {
75 | return animation.size
76 | }
77 | return super.size
78 | }
79 | #endif
80 |
81 | public required convenience init?(animatedCoder: SDAnimatedImageCoder, scale: CGFloat) {
82 | guard let data = animatedCoder.animatedImageData else {
83 | return nil
84 | }
85 | self.init(data: data, scale: scale, options: nil)
86 | }
87 |
88 | //MARK: - NSSecureCoding
89 | #if os(iOS) || os(tvOS)
90 | required public init?(coder: NSCoder) {
91 | super.init(coder: coder)
92 | decode(with: coder)
93 | }
94 | #endif
95 |
96 | #if os(macOS)
97 | required public init(coder: NSCoder) {
98 | // Hack: Why NSImage on AppKit use another non-optional NSCoding ?
99 | super.init(coder: coder)
100 | decode(with: coder)
101 | }
102 | #endif
103 |
104 | private func decode(with coder: NSCoder) {
105 | if let data = coder.decodeObject(of: NSData.self, forKey: "animatedImageData") as? Data {
106 | let animation: Animation
107 | do {
108 | animation = try JSONDecoder().decode(Animation.self, from: data)
109 | } catch let error {
110 | print(error)
111 | return
112 | }
113 | self.animation = animation
114 | self.animatedImageData = data
115 | #if os(macOS)
116 | self.size = animation.size
117 | #endif
118 | }
119 | }
120 |
121 | public override func encode(with coder: NSCoder) {
122 | super.encode(with: coder)
123 | if let animatedImageData = animatedImageData {
124 | coder.encode(animatedImageData, forKey: "animatedImageData")
125 | }
126 | }
127 |
128 | #if os(macOS)
129 | required init?(pasteboardPropertyList propertyList: Any, ofType type: NSPasteboard.PasteboardType) {
130 | super.init(pasteboardPropertyList: propertyList, ofType: type)
131 | }
132 | #endif
133 |
134 | // MARK: - Helper
135 | lazy var compositionLayer: LottieCompositionLayer? = {
136 | guard let animation = animation else {
137 | return nil
138 | }
139 | let compositionLayer = LottieCompositionLayer(animation: animation, imageProvider: imageProvider, textProvider: textProvider, fontProvider: fontProvider)
140 | return compositionLayer
141 | }()
142 |
143 | func createFrame(with animation: Animation, frameIndex: UInt) -> PlatformImage? {
144 | // We use AnimationFrameTime(Seconds * Framerate) as frame count, so this is 1:1 mapping
145 | let frame = CGFloat(frameIndex)
146 | guard let compositionLayer = compositionLayer else {
147 | return nil
148 | }
149 | compositionLayer.displayWithFrame(frame: frame, forceUpdates: true)
150 | let renderer = SDGraphicsImageRenderer(size: animation.size)
151 | let image = renderer.image { context in
152 | // Render CALayer for current frame
153 | compositionLayer.render(in: context)
154 | }
155 | return image
156 | }
157 |
158 | // MARK: - SDAnimatedImageProvider && Frame Extracting
159 | public private(set) var animatedImageData: Data?
160 |
161 | public var animatedImageFrameCount: UInt {
162 | guard let animation = animation else {
163 | return 0
164 | }
165 | return UInt(animation.endFrame - animation.startFrame)
166 | }
167 |
168 | public var animatedImageLoopCount: UInt {
169 | return 0
170 | }
171 |
172 | public func animatedImageFrame(at index: UInt) -> PlatformImage? {
173 | guard let animation = animation else {
174 | return nil
175 | }
176 | let image = createFrame(with: animation, frameIndex: index)
177 | return image
178 | }
179 |
180 | public func animatedImageDuration(at index: UInt) -> TimeInterval {
181 | guard let animation = animation else {
182 | return 0
183 | }
184 | let frameCount = self.animatedImageFrameCount
185 | if frameCount == 0 {
186 | return 0
187 | }
188 | return animation.duration / Double(frameCount)
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/SDWebImageLottiePlugin/Module/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 |
22 |
23 |
--------------------------------------------------------------------------------