All Projects → HeroTransitions → Hero

HeroTransitions / Hero

Licence: mit
Elegant transition library for iOS & tvOS

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Hero

Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (-94.26%)
Mutual labels:  xcode, carthage, animations, ios-animation
Lottie Ios
An iOS library to natively render After Effects vector animations
Stars: ✭ 22,295 (+8.51%)
Mutual labels:  ios-animation, transition-animation, ios-transition, custom-transitions
Nvactivityindicatorview
A collection of awesome loading animations
Stars: ✭ 10,031 (-51.18%)
Mutual labels:  ios-lib, carthage, ios-animation
Swiftui Animation Library
SwiftUI Animation Library. Useful SwiftUI animations including Loading/progress, Looping, On-off, Enter, Exit, Fade, Spin and Background animations that you can directly implement in your next iOS application or project. The library also contains huge examples of spring animations such as Inertial Bounce, Shake, Twirl, Jelly, Jiggle, Rubber Band, Kitchen Sink and Wobble effects. Browse, find and download the animation that fits your needs.
Stars: ✭ 898 (-95.63%)
Mutual labels:  xcode, animations, transition-animation
Pvview
A small library that helps you to make an amazing parallax view
Stars: ✭ 227 (-98.9%)
Mutual labels:  ios-lib, ios-animation, transition-animation
Materialactivityindicator
Material Activity Indicator
Stars: ✭ 109 (-99.47%)
Mutual labels:  xcode, swiftpm, material-design
Costumekit
Base types for theming an app.
Stars: ✭ 300 (-98.54%)
Mutual labels:  ios-lib, carthage
Kdintroview
Stars: ✭ 300 (-98.54%)
Mutual labels:  ios-lib, ios-animation
Microfeatures Guidelines
📦📝 uFeatures guidelines
Stars: ✭ 315 (-98.47%)
Mutual labels:  xcode, carthage
React Native Dating App
Dating app - Exponent and React Native
Stars: ✭ 352 (-98.29%)
Mutual labels:  animations, ios-animation
Swiftscan
A barcode and qr code scanner( 二维码/条形码扫描、生成,仿微信、支付宝)
Stars: ✭ 293 (-98.57%)
Mutual labels:  xcode, carthage
Maplebacon
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations
Stars: ✭ 322 (-98.43%)
Mutual labels:  xcode, carthage
Azteceditor Ios
A reusable native iOS visual HTML text editor component.
Stars: ✭ 437 (-97.87%)
Mutual labels:  ios-lib, carthage
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (-97.89%)
Mutual labels:  carthage, ios-animation
Anyformatkit
Simple text formatting in Swift
Stars: ✭ 296 (-98.56%)
Mutual labels:  xcode, carthage
Stevia
🍃 Concise Autolayout code
Stars: ✭ 3,182 (-84.51%)
Mutual labels:  xcode, carthage
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! 🦊
Stars: ✭ 3,188 (-84.48%)
Mutual labels:  xcode, carthage
Tbuiautotest
Generating UI test label automatically for iOS.
Stars: ✭ 333 (-98.38%)
Mutual labels:  xcode, carthage
Dashboard reborn
A very sexy Flutter UI template✨
Stars: ✭ 375 (-98.17%)
Mutual labels:  material-design, animations
Xcglogger
A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.
Stars: ✭ 3,710 (-81.94%)
Mutual labels:  carthage, swiftpm

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.

Carthage compatible Accio supported codecov Version License Xcode 9.0+ iOS 8.0+ Swift 4.0+ 中文 README Donate

      

Hero 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.

Hero 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.

At 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 & heroModifiers to make your own unique transitions.

      

By default, Hero provides dynamic duration based on the Material Design Motion Guide. Duration is automatically determined by changes to distance and size—saving you the hassle, while providing consistent and delightful animations.

Hero 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...

Usage Example 1

View Controller 1

redView.hero.id = "ironMan"
blackView.hero.id = "batMan"

View Controller 2

self.hero.isEnabled = true
redView.hero.id = "ironMan"
blackView.hero.id = "batMan"
whiteView.hero.modifiers = [.translate(y:100)]

Usage Example 2

View Controller 1

greyView.hero.id = "skyWalker"

View Controller 2

self.hero.isEnabled = true
greyView.hero.id = "skyWalker"

// collectionView is the parent view of all red cells
collectionView.hero.modifiers = [.cascade]
for cell in redCells {
    cell.hero.modifiers = [.fade, .scale(0.5)]
}

You can do these in the storyboard too!

Installation

CocoaPods

Add the following entry to your Podfile:

pod 'Hero'

Then run pod install.

Don't forget to import Hero in every file you'd like to use Hero.

Carthage

Add the following entry to your Cartfile:

github "HeroTransitions/Hero"

Then run carthage update.

If this is your first time using Carthage in the project, you'll need to go through some additional steps as explained over at Carthage.

Accio

Add the following to your Package.swift:

.package(url: "https://github.com/HeroTransitions/Hero.git", .upToNextMajor(from: "1.4.0")),

Next, add Hero to your App targets dependencies like so:

.target(
    name: "App",
    dependencies: [
        "Hero",
    ]
),

Then run accio update.

Swift Package Manager

To integrate using Apple's Swift package manager, add the following as a dependency to your Package.swift:

.package(url: "https://github.com/HeroTransitions/Hero.git", .upToNextMajor(from: "1.3.0"))

and then specify "Hero" as a dependency of the Target in which you wish to use Hero. Here's an example PackageDescription:

// swift-tools-version:4.0
import PackageDescription

let package = Package(
    name: "MyPackage",
    products: [
        .library(
            name: "MyPackage",
            targets: ["MyPackage"]),
    ],
    dependencies: [
        .package(url: "https://github.com/HeroTransitions/Hero.git", .upToNextMajor(from: "1.6.1"))
    ],
    targets: [
        .target(
            name: "MyPackage",1.6.1
            dependencies: ["Hero"])
    ]
)

Manually

  • Drag the Sources folder anywhere in your project.

Documentations

Checkout the WIKI PAGES (Usage Guide) for documentations.

For more up-to-date ones, please see the header-doc. (use alt+click in Xcode)

Interactive Transition Tutorials

Interactive transitions with Hero (Part 1)

FAQ

Not able to use Hero transition even when self.hero.isEnabled is set to true

Make sure that you have also enabled self.hero.isEnabled on the navigation controller if you are doing a push/pop inside the navigation controller.

Views being covered by another matched view during the transition

Matched 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 for details.

Push animation is shown along side my custom animation

This 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.

How do I use a different default animation when dismissing

You can use the animation type .selectBy(presenting:dismissing) to specify a different default animation for dismiss.

For example:

    self.hero.modalAnimationType = .selectBy(presenting:.zoom, dismissing:.zoomOut)

Contribute

We welcome any contributions. Please read the Contribution Guide.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].