{"id":28559049,"url":"https://github.com/sdwebimage/sdwebimagelottieplugin","last_synced_at":"2025-10-17T09:57:09.905Z","repository":{"id":37644876,"uuid":"243927619","full_name":"SDWebImage/SDWebImageLottiePlugin","owner":"SDWebImage","description":"SDWebImage integration with Lottie Animation using remote JSON files","archived":false,"fork":false,"pushed_at":"2022-07-09T08:36:55.000Z","size":848,"stargazers_count":19,"open_issues_count":2,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T00:34:14.496Z","etag":null,"topics":["carthage","cocoapods","ios","lottie","macos","sdwebimage","swift","swiftpm","tvos"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SDWebImage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-29T07:54:33.000Z","updated_at":"2024-07-08T20:54:21.000Z","dependencies_parsed_at":"2022-07-12T16:42:11.831Z","dependency_job_id":null,"html_url":"https://github.com/SDWebImage/SDWebImageLottiePlugin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/SDWebImage/SDWebImageLottiePlugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageLottiePlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageLottiePlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageLottiePlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageLottiePlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SDWebImage","download_url":"https://codeload.github.com/SDWebImage/SDWebImageLottiePlugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageLottiePlugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279322083,"owners_count":26148101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-17T02:00:07.504Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","cocoapods","ios","lottie","macos","sdwebimage","swift","swiftpm","tvos"],"created_at":"2025-06-10T08:35:58.226Z","updated_at":"2025-10-17T09:57:09.873Z","avatar_url":"https://github.com/SDWebImage.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SDWebImageLottiePlugin\n\n[![CI Status](https://img.shields.io/travis/SDWebImage/SDWebImageLottiePlugin.svg?style=flat)](https://travis-ci.org/SDWebImage/SDWebImageLottiePlugin)\n[![Version](https://img.shields.io/cocoapods/v/SDWebImageLottiePlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImageLottiePlugin)\n[![License](https://img.shields.io/cocoapods/l/SDWebImageLottiePlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImageLottiePlugin)\n[![Platform](https://img.shields.io/cocoapods/p/SDWebImageLottiePlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImageLottiePlugin)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg?style=flat)](https://github.com/SDWebImage/SDWebImageLottiePlugin)\n[![codecov](https://codecov.io/gh/SDWebImage/SDWebImageLottiePlugin/branch/master/graph/badge.svg)](https://codecov.io/gh/SDWebImage/SDWebImageLottiePlugin)\n\n## What's for\nSDWebImageLottiePlugin 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.\n\nYou can find more resource about Lottie in their [Official Site](https://airbnb.design/lottie/).\n\n## Requirements\n\n+ iOS 11+\n+ macOS 10.11+\n+ tvOS 11+\n+ Xcode 11+\n\n## Installation\n\n#### Swift Package Manager\n\nSDWebImageWebPCoder is available through [Swift Package Manager](https://swift.org/package-manager).\n\n```swift\nlet package = Package(\n    dependencies: [\n        .package(url: \"https://github.com/SDWebImage/SDWebImageLottiePlugin.git\", from: \"1.0.0\")\n    ]\n)\n```\n\n#### CocoaPods\n\nSDWebImageLottiePlugin is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'SDWebImageLottiePlugin', '~\u003e 1.0'\n```\n\n#### Carthage (Deprecated)\n\nSDWebImageLottiePlugin is available through [Carthage](https://github.com/Carthage/Carthage).\n\n```\ngithub \"SDWebImage/SDWebImageLottiePlugin\", ~\u003e 1.0\n```\n\nNote:\n1. 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 👀\n\n## Lottie 2 \u0026\u0026 Objective-C\n\nLottie 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) 🚀\n\nSo 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+.\n\nFor 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)\n\n## Usage\n\n### Load Lottie from remote JSON\n\n+ Swift\n\n```swift\nlet animationView: Lottie.AnimationView\nlet lottieJSONURL: URL\nanimationView.sd_setImage(with: lottieJSONURL)\n```\n\nNote:\n+ You can also load lottie json files on `AnimatedControl`, like switch button.\n+ Lottie animation does not start automatically, you can use the completion block, or UITableView/UICollectionView's will display timing to play.\n\n```swift\nanimationView.sd_setImage(with: lottieUrl, completed: { _,_,_,_ in\n    self.animationView.play(fromProgress: 0, toProgress: 1, loopMode: .repeat(5)) { finished in\n        // ...\n    }\n}\n```\n\n\n+ If your Lottie json files contains references to App bundle images, just set the `imageProvider` before the lottie animation start.\n\n```swift\nlet bundle = Bundle(for: MyBundleClass.self)\nanimationView.imageProvider = BundleImageProvider(bundle: bundle, searchPath: nil)\nanimationView.sd_setImage(with: lottieUrl)\n```\n\n### Advanced usage\n\nThis 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.\n\n+ Swift\n\n```swift\nlet animation = try? JSONDecoder().decode(Animation.self, from: data)\nlet animatedImage = LottieImage(animation: animation)\n// Optional, custom image bundle\nanimatedImage.imageProvider = BundleImageProvider(bundle: bundle, searchPath: nil)\n// Snapshot Lottie animation frame\nlet posterFrame = animatedImage.animatedImageFrame(at: 0)\nlet duration = animatedImage.animatedImageDuration(at: 0)\n```\n\nNote:\n+ 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.\n\n## Demo\n\nIf you have some issue about usage, SDWebImageLottiePlugin provide a demo for iOS \u0026\u0026 macOS platform. To run the demo, clone the repo and run the following command.\n\n```bash\ncd Example/\npod install\nopen SDWebImageLottiePlugin.xcworkspace\n```\n\nAfter the Xcode project was opened, click `Run` to build and run the demo.\n\n## Screenshot\n\n+ iOS Demo\n\n\u003cimg src=\"https://raw.githubusercontent.com/SDWebImage/SDWebImageLottiePlugin/master/Example/Screenshot/LottieDemo.gif\" width=\"300\" /\u003e\n\n+ macOS Demo\n\n\u003cimg src=\"https://raw.githubusercontent.com/SDWebImage/SDWebImageLottiePlugin/master/Example/Screenshot/LottieDemo-macOS.gif\" width=\"300\" /\u003e\n\nThe lottie json files are from [lottie-web example](https://github.com/airbnb/lottie-web)\n\n## Author\n\nDreamPiggy\n\n## License\n\nSDWebImageLottiePlugin is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdwebimage%2Fsdwebimagelottieplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdwebimage%2Fsdwebimagelottieplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdwebimage%2Fsdwebimagelottieplugin/lists"}