{"id":18802392,"url":"https://github.com/jd-opensource/xanimation","last_synced_at":"2026-03-08T16:32:49.556Z","repository":{"id":62822552,"uuid":"562725057","full_name":"jd-opensource/XAnimation","owner":"jd-opensource","description":"使用 XAnimation， 你可以快速将设计师设计的lottie动效，应用到你的 App 中现有的任何视图（或图层）上","archived":false,"fork":false,"pushed_at":"2022-11-18T06:54:07.000Z","size":193,"stargazers_count":88,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-04T23:24:47.116Z","etag":null,"topics":["bind-lottie-effect"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jd-opensource.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":"2022-11-07T05:48:38.000Z","updated_at":"2025-02-08T02:06:22.000Z","dependencies_parsed_at":"2022-11-07T10:15:20.982Z","dependency_job_id":null,"html_url":"https://github.com/jd-opensource/XAnimation","commit_stats":null,"previous_names":["jdfed/xanimation"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jd-opensource/XAnimation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-opensource%2FXAnimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-opensource%2FXAnimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-opensource%2FXAnimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-opensource%2FXAnimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jd-opensource","download_url":"https://codeload.github.com/jd-opensource/XAnimation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-opensource%2FXAnimation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278840726,"owners_count":26055192,"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-07T02:00:06.786Z","response_time":59,"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":["bind-lottie-effect"],"created_at":"2024-11-07T22:27:49.573Z","updated_at":"2025-10-07T20:32:55.528Z","avatar_url":"https://github.com/jd-opensource.png","language":"Objective-C","readme":"# XAnimation\n\n[![CI Status](https://img.shields.io/travis/wangxiyuan/XAnimation.svg?style=flat)](https://travis-ci.org/wangxiyuan/XAnimation)\n[![Version](https://img.shields.io/cocoapods/v/XAnimation.svg?style=flat)](https://cocoapods.org/pods/XAnimation)\n[![License](https://img.shields.io/cocoapods/l/XAnimation.svg?style=flat)](https://cocoapods.org/pods/XAnimation)\n[![Platform](https://img.shields.io/cocoapods/p/XAnimation.svg?style=flat)](https://cocoapods.org/pods/XAnimation)\n\n\n## Introduce 简介 😊\n\n\u003cfont face=\"微软雅黑\" size=\"3\"\u003e使用 **XAnimation**， 你可以快速将设计师设计的动画效果，应用到你的 App 中现有的任何视图（或图层）上，由于 XAnimation 基于 **Lottie** 进行二次开源，因此它同样具备以下特征：\u003c/font\u003e\n\n* **\u003cfont face=\"微软雅黑\" size=\"3\" color=\"orange\"\u003e高还原度 🎆\u003c/font\u003e**\n* **\u003cfont face=\"微软雅黑\" size=\"3\"  color=\"orange\"\u003e少代码 ♻️\u003c/font\u003e**\n* **\u003cfont face=\"微软雅黑\" size=\"3\"  color=\"orange\"\u003e高稳定性 💪\u003c/font\u003e**\n\n\u003ccenter class=\"half\"\u003e\n    \u003cimg src=\"https://m.360buyimg.com/img/jfs/t1/173991/10/29856/153907/6322edf7E24daff56/25206a5a6cac1771.png\" style=\"margin-right: 10px\" width=\"600\"/\u003e\n\u003c/center\u003e\n\n\n## Example 效果预览\n\n\u003e 你可以在 Example 工程中体验它。\n\n\u003cdiv\u003e\n    \u003cimg src=\"https://storage.360buyimg.com/xview/xanimation/p1.gif\" style=\"border:#000000 3px solid;  margin-right: 10px;margin-bottom: 10px\" width=\"260\"/\u003e\n    \u003cimg src=\"https://storage.360buyimg.com/xview/xanimation/p2.gif\" style=\"border:#000000 3px solid;  margin-right: 10px;margin-bottom: 10px\" width=\"260\"/\u003e\n    \u003cimg src=\"https://storage.360buyimg.com/xview/xanimation/p3.gif\" style=\"border:#000000 3px solid;  margin-right: 10px;margin-bottom: 10px\" width=\"260\"/\u003e\n    \u003cimg src=\"https://storage.360buyimg.com/xview/xanimation/p4.gif\" style=\"border:#000000 3px solid;  margin-right: 10px;margin-bottom: 10px\" width=\"260\"/\u003e\n    \u003cimg src=\"https://storage.360buyimg.com/xview/xanimation/p5.gif\" style=\"border:#000000 3px solid;  margin-right: 10px;margin-bottom: 10px\" width=\"260\"/\u003e\n    \u003cimg src=\"https://storage.360buyimg.com/xview/xanimation/p6.gif\" style=\"border:#000000 3px solid;  margin-right: 10px;margin-bottom: 10px\" width=\"260\"/\u003e\n\u003c/div\u003e\n\n\n## Requirements\n\u003cfont face=\"微软雅黑\" size=\"2\"\u003eiOS 9.0+\u003c/font\u003e\n\u003cbr /\u003e\n\n## Installation 安装\n\n\u003cfont face=\"微软雅黑\" size=\"3\"\u003eXAnimation 可以通过 CocoaPods 来安装 (https://cocoapods.org) 只需要将下面代码加入到 Podfile 中。\u003c/font\u003e\n\n```ruby\npod install 'XAnimation'\n```\n\n## API 使用\n\n\u003e 以下调示例为 UIView 绑定动画， CALayer 可以直接去源码看相关接口定义.\n\n\u003cfont face=\"微软雅黑\" size=\"3\"\u003e\n\n1. 依赖头文件.\n```objc\n#import \u003cXAnimation/UIView+XALottie.h\u003e\n#import \u003cXAnimation/XABindLottieController.h\u003e\n```\n\n2.  Lottie 绑定到一个根 UIView（或 CALayer）上.\n```objc\n/**\n * animationName 即为本地Json文件名\n * aView 你的任意一个视图\n */\n[aView bindLottieWithAnimationNamed:@\"牌子动画（旋转+位移+缩放）\"];\n```\n\n3. 你的视图绑定 Lottie json 中某个图层.\n```objc\n[aView bindLottieLayerName:@\"牌子\"];\n```\n\n4. 播放动画.\n```objc\n[[aView currentBindController] play];\n```\n\u003c/font\u003e\n\n## Future 展望\n\u003cfont face=\"微软雅黑\" size=\"3\" color=\"#696969\"\u003e\n请试想，动画绑定的能力该如何运用呢？\n\u003cbr/\u003e\n每个人可能都有不同想法 🤔， 但这里有一个推荐，我现在对上面的流程做一点点改进，将 App 中的视图和 Lottie 中的图层的绑定关系，改为后台配置，这样流程看起来会像下图：\n\u003c/font\u003e\n\n\u003ccenter class=\"half\"\u003e\n    \u003cimg src=\"https://storage.360buyimg.com/xview/xanimation/XAConfig.png\" style=\"margin-right: 10px\" width=\"700\"/\u003e\n\u003c/center\u003e\n\n\u003cfont face=\"微软雅黑\" size=\"3\"\u003e这样做的好处是：\u003c/font\u003e\n- \u003cfont face=\"微软雅黑\" size=\"3\" color=\"orange\"\u003e0 代码开发，任意时刻配置，可立即上线\u003c/font\u003e\n- \u003cfont face=\"微软雅黑\" size=\"3\" color=\"orange\"\u003e减少测试环节，由平台提供稳定性，提高效能\u003c/font\u003e\n\n\u003cfont face=\"微软雅黑\" size=\"3\"\u003e好了，现在你能想到哪些配置应用场景呢？比如：春节的时候🧨🧨🧨，让你的大 Icon 开心的跳起来？😄\u003c/font\u003e\n\n\n## Author 作者\n\n\u003cfont face=\"微软雅黑\" size=\"3\"\u003ewangxiyuan (wangxiyuan613@163.com)\u003c/font\u003e\n\u003cbr/\u003e\n如果你有更多更好的想法，欢迎发件交流 🤝🤝🤝。\n\n## License 版权\n\u003cfont face=\"微软雅黑\" size=\"3\"\u003e\nXAnimation is available under the Apache License 2.0. See the LICENSE file for more info.\n\u003c/font\u003e\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd-opensource%2Fxanimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjd-opensource%2Fxanimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd-opensource%2Fxanimation/lists"}