Latest 0.0.1
License MIT
Platforms ios 9.0, requires ARC
Dependencies Hero

Carthage compatible
Xcode 8.2+
iOS 8.0+
Swift 3.0+

Fancy elastic transition powered by Metal, UIKit Dynamics, & Hero:

Just a proof of concept inspired by Álvaro Carreras’s Slide Concept. Not really optimized and does not support older devices. You should not use this in production. If you want something similar, checkout ElasticTransition

Supports UINavigationController, UITabBarController, & Modal Present. Since it is powered by Hero, the other views can still benefit from animations constructed by Hero.


  • Xcode 8.2
  • Swift 3.0.2
  • Metal compatible devices (iPhone 5s or newer)

Won’t work on simulator.


pod "Elastic"


  override func viewDidLoad() {
    // 1. Enable the plugin
    ElasticHeroPlugin.isEnabled = true

    // 2. setup a gesture recognizer
    let leftGR = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(pan(gr:)))
    leftGR.edges = UIRectEdge.left

    // 3. set the heroModifier of the elastic view to be
    view.heroModifiers = [.elastic(edge: .left, gestureRecognizer: leftGR)]

  func pan(gr:UIScreenEdgePanGestureRecognizer){
    if gr.state == .began {
      // 4. perform your transition when the gesture recognizer begans. the rest will be handled automatically
      performSegue(withIdentifier: "next", sender: nil)

The elastic view doesn’t have to be the gesture recognizer’s view. For example, the following code makes the next view controller’s view elastic.

  // This replaces step 3
  override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    let vc = segue.destination
    vc.view.heroModifiers = [.elastic(edge: .right, gestureRecognizer: rightGR)]


Elastic is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "Elastic",
    "version": "0.0.1",
    "summary": "Fancy elastic transition powered by Metal, UIKit Dynamics, & Hero",
    "description": "Fancy elastic transition powered by Metal, UIKit Dynamics, & Hero. Written in Swift.",
    "homepage": "",
    "screenshots": "",
    "license": "MIT",
    "authors": {
        "Luke": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.0.1"
    "platforms": {
        "ios": "9.0"
    "ios": {
        "frameworks": [
    "requires_arc": true,
    "source_files": "Sources/*.swift",
    "dependencies": {
        "Hero": []
    "pushed_with_swift_version": "3.0.2"

Pin It on Pinterest

Share This