{"id":2388,"url":"https://github.com/HeroTransitions/Hero","last_synced_at":"2025-08-13T16:32:59.799Z","repository":{"id":37451299,"uuid":"74697963","full_name":"HeroTransitions/Hero","owner":"HeroTransitions","description":"Elegant transition library for iOS \u0026 tvOS","archived":false,"fork":false,"pushed_at":"2024-02-06T02:04:31.000Z","size":31385,"stargazers_count":22052,"open_issues_count":39,"forks_count":1725,"subscribers_count":362,"default_branch":"develop","last_synced_at":"2024-10-29T12:25:41.787Z","etag":null,"topics":["animation","animations","carthage","custom-transitions","hero","ios","ios-animation","ios-framework","ios-lib","ios-swift","ios-transition","layout","material-design","swift","swiftpm","transition-animation","xcode"],"latest_commit_sha":null,"homepage":"https://HeroTransitions.github.io/Hero/","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/HeroTransitions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["JoeMatt","lkzhao","SD10","kuyazee"],"patreon":null,"open_collective":"herotransitions","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-11-24T18:49:37.000Z","updated_at":"2024-10-28T13:22:46.000Z","dependencies_parsed_at":"2024-01-17T02:12:44.095Z","dependency_job_id":"dfbacf25-cf20-497f-b153-6f52f6f27fd8","html_url":"https://github.com/HeroTransitions/Hero","commit_stats":{"total_commits":542,"total_committers":86,"mean_commits":"6.3023255813953485","dds":0.6254612546125462,"last_synced_commit":"a85993cbdc1dfaf5db2cbacd376d4e3dbe09e753"},"previous_names":["lkzhao/hero"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeroTransitions%2FHero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeroTransitions%2FHero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeroTransitions%2FHero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeroTransitions%2FHero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HeroTransitions","download_url":"https://codeload.github.com/HeroTransitions/Hero/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222383913,"owners_count":16975395,"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","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":["animation","animations","carthage","custom-transitions","hero","ios","ios-animation","ios-framework","ios-lib","ios-swift","ios-transition","layout","material-design","swift","swiftpm","transition-animation","xcode"],"created_at":"2024-01-05T20:16:12.550Z","updated_at":"2024-12-15T01:30:18.369Z","avatar_url":"https://github.com/HeroTransitions.png","language":"Swift","readme":"\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/427d5f2/Resources/Hero.svg\" width=\"388\"/\u003e\n\n**Hero** is a library for building iOS view controller transitions. It provides a declarative layer on top of the UIKit's cumbersome transition APIs—making custom transitions an easy task for developers.\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Accio supported](https://img.shields.io/badge/Accio-supported-0A7CF5.svg?style=flat)](https://github.com/JamitLabs/Accio)\n[![codecov](https://codecov.io/gh/HeroTransitions/Hero/branch/develop/graph/badge.svg)](https://codecov.io/gh/HeroTransitions/Hero)\n[![Version](https://img.shields.io/cocoapods/v/Hero.svg?style=flat)](http://cocoapods.org/pods/Hero)\n[![License](https://img.shields.io/cocoapods/l/Hero.svg?style=flat)](https://github.com/lkzhao/Hero/blob/master/LICENSE?raw=true)\n![Xcode 10.0+](https://img.shields.io/badge/Xcode-10.0%2B-blue.svg)\n![iOS 10.0+](https://img.shields.io/badge/iOS-10.0%2B-blue.svg)\n![Swift 4.0+](https://img.shields.io/badge/Swift-4.0%2B-orange.svg)\n[![中文 README](https://img.shields.io/badge/%E4%B8%AD%E6%96%87-README-blue.svg?style=flat)](https://github.com/lkzhao/Hero/blob/master/README.zh-cn.md)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=NT5F7Y2MPV7RE)\n\n[![Unit Test](https://github.com/HeroTransitions/Hero/actions/workflows/test.yml/badge.svg)](https://github.com/HeroTransitions/Hero/actions/workflows/test.yml)\n[![Swift PM](https://github.com/HeroTransitions/SwiftPMTest/actions/workflows/spm.yml/badge.svg)](https://github.com/HeroTransitions/SwiftPMTest/actions/workflows/spm.yml)\n\n\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/ebb3f2c/Resources/features.svg\"/\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/ebb3f2c/Resources/features2.svg\"/\u003e\n\nHero is similar to Keynote's **Magic Move**. It checks the `heroID` property on all source and destination views. Every matched view pair is then automatically transitioned from its old state to its new state.\n\nHero can also construct animations for unmatched views. It is easy to define these animations via the `heroModifiers` property. Hero will run these animations alongside the **Magic Move** animations. All of these animations can be **interactively controlled** by user gestures.\n\nAt view controller level, Hero provides several template transitions that you can set through `heroModalAnimationType`, `heroNavigationAnimationType`, and `heroTabBarAnimationType`. These can be used as the foundation of your custom transitions. Combine with `heroID` \u0026 `heroModifiers` to make your own unique transitions.\n\n\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/ebb3f2c/Resources/defaultAnimations.svg\"/\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/ebb3f2c/Resources/defaultAnimations2.svg\"/\u003e\n\nBy default, Hero provides **dynamic duration** based on the [Material Design Motion Guide](https://material.io/design/motion/speed.html#easing). Duration is automatically determined by changes to distance and size—saving you the hassle, while providing consistent and delightful animations.\n\nHero doesn't make any assumptions about how the view is built or structured. It won't modify any of your views' states other than hiding them during the animation. This makes it work with **Auto Layout**, **programmatic layout**, **UICollectionView** (without modifying its layout object), **UITableView**, **UINavigationController**, **UITabBarController**, etc...\n\n## Usage Example 1\n\n\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/ebb3f2c/Resources/simple.svg\" /\u003e\n\n### View Controller 1\n\n```swift\nredView.hero.id = \"ironMan\"\nblackView.hero.id = \"batMan\"\n```\n\n### View Controller 2\n\n```swift\nself.hero.isEnabled = true\nredView.hero.id = \"ironMan\"\nblackView.hero.id = \"batMan\"\nwhiteView.hero.modifiers = [.translate(y:100)]\n```\n\n## Usage Example 2\n\n\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/ebb3f2c/Resources/advanced.svg\" /\u003e\n\n### View Controller 1\n\n```swift\ngreyView.hero.id = \"skyWalker\"\n```\n\n### View Controller 2\n\n```swift\nself.hero.isEnabled = true\ngreyView.hero.id = \"skyWalker\"\n\n// collectionView is the parent view of all red cells\ncollectionView.hero.modifiers = [.cascade]\nfor cell in redCells {\n    cell.hero.modifiers = [.fade, .scale(0.5)]\n}\n```\n\nYou can do these in the **storyboard** too!\n\n\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/master/Resources/storyboardView.png\" width=\"267px\"/\u003e\n\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/master/Resources/storyboardViewController.png\" width=\"267px\"/\u003e\n\n## Installation\n\n### CocoaPods\n\nAdd the following entry to your Podfile:\n\n```rb\npod 'Hero'\n```\n\nThen run `pod install`.\n\nDon't forget to `import Hero` in every file you'd like to use Hero.\n\n### Carthage\n\nAdd the following entry to your `Cartfile`:\n\n```text\ngithub \"HeroTransitions/Hero\"\n```\n\nThen run `carthage update`.\n\nIf this is your first time using Carthage in the project, you'll need to go through some additional steps as explained [over at Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application).\n\n### Accio\n\nAdd the following to your `Package.swift`:\n\n```swift\n.package(url: \"https://github.com/HeroTransitions/Hero.git\", .upToNextMajor(from: \"1.4.0\")),\n```\n\nNext, add `Hero` to your App targets dependencies like so:\n\n```swift\n.target(\n    name: \"App\",\n    dependencies: [\n        \"Hero\",\n    ]\n),\n```\n\nThen run `accio update`.\n\n### Swift Package Manager\n\nTo integrate using Apple's Swift package manager, add the following as a dependency to your `Package.swift`:\n\n```swift\n.package(url: \"https://github.com/HeroTransitions/Hero.git\", .upToNextMajor(from: \"1.3.0\"))\n```\n\nand then specify `\"Hero\"` as a dependency of the Target in which you wish to use Hero.\nHere's an example `PackageDescription`:\n\n```swift\n// swift-tools-version:4.0\nimport PackageDescription\n\nlet package = Package(\n    name: \"MyPackage\",\n    products: [\n        .library(\n            name: \"MyPackage\",\n            targets: [\"MyPackage\"]),\n    ],\n    dependencies: [\n        .package(url: \"https://github.com/HeroTransitions/Hero.git\", .upToNextMajor(from: \"1.6.3\"))\n    ],\n    targets: [\n        .target(\n            name: \"MyPackage\",\n            dependencies: [\"Hero\"])\n    ]\n)\n```\n\n### Manually\n\n- Drag the **Sources** folder anywhere in your project.\n\n## Documentations\n\nCheckout the **[WIKI PAGES (Usage Guide)](https://github.com/lkzhao/Hero/wiki/Usage-Guide)** for documentations.\n\nFor more up-to-date ones, please see the header-doc. (use **alt+click** in Xcode)\n\u003cimg src=\"https://cdn.rawgit.com/lkzhao/Hero/master/Resources/headerDoc.png\" width=\"521px\"/\u003e\n\nDash compatible API docs: https://HeroTransitions.github.io/Hero/\n\n## Interactive Transition Tutorials\n\n[Interactive transitions with Hero (Part 1)](https://lkzhao.gitbooks.io/hero/content/docs/InteractiveTransition.html)\n\n## FAQ\n\n### Not able to use Hero transition even when `self.hero.isEnabled` is set to true\n\nMake sure that you have also enabled `self.hero.isEnabled` on the navigation controller if you are doing a push/pop inside the navigation controller.\n\n### Views being covered by another matched view during the transition\n\nMatched views use global coordinate space while unmatched views use local coordinate space by default. Local coordinate spaced views might be covered by other global coordinate spaced views. To solve this, use the `useGlobalCoordinateSpace` modifier on the views being covered. Checkout [Coordinate Space Wiki page](https://github.com/lkzhao/Hero/wiki/Coordinate-Space) for details.\n\n### Push animation is shown along side my custom animation\n\nThis is the default animation for navigation controller provided by Hero. To disable the push animation, set `self.hero.navigationAnimationType` to `.fade` or `.none` on the navigation controller.\n\n### How do I use a different default animation when dismissing\n\nYou can use the animation type `.selectBy(presenting:dismissing)` to specify a different default animation for dismiss.\n\nFor example:\n\n```swift\n    self.hero.modalAnimationType = .selectBy(presenting:.zoom, dismissing:.zoomOut)\n```\n\n## Contribute\n\nWe welcome any contributions. Please read the [Contribution Guide](https://github.com/lkzhao/Hero/wiki/Contribution-Guide).\n","funding_links":["https://github.com/sponsors/JoeMatt","https://github.com/sponsors/lkzhao","https://github.com/sponsors/SD10","https://github.com/sponsors/kuyazee","https://opencollective.com/herotransitions","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=NT5F7Y2MPV7RE"],"categories":["UI","Libs","Swift Tools and Frameworks","Swift Tools, Libraries, and Frameworks","Swift Development","Tools","Animation","Swift Tools","Swift","HarmonyOS","UI [🔝](#readme)","iOS","Content","xcode","UI/UX"],"sub_categories":["Transition","UI","Interfaces","Swift Tools, Libraries, and Frameworks","JavaScript Libraries for Machine Learning","Mesh networks","In-memory data grids","Windows Manager","Hero"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeroTransitions%2FHero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHeroTransitions%2FHero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeroTransitions%2FHero/lists"}