> For the complete documentation index, see [llms.txt](https://cosmicmind.gitbook.io/motion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cosmicmind.gitbook.io/motion/overview/transitions.md).

# Transitions

Motion transitions a source view to a destination view using a linking identifier property named `motionIdentifier`.

| Match                                                                       | Translate                                                                           | Rotate                                                                        | Arc                                                                     | Scale                                                                       |
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| ![Match](http://www.cosmicmind.com/motion/transitions_identifier/match.gif) | ![Translate](http://www.cosmicmind.com/motion/transitions_identifier/translate.gif) | ![Rotate](http://www.cosmicmind.com/motion/transitions_identifier/rotate.gif) | ![Arc](http://www.cosmicmind.com/motion/transitions_identifier/arc.gif) | ![Scale](http://www.cosmicmind.com/motion/transitions_identifier/scale.gif) |

### Example Usage

An example of transitioning from one view controller to another with transitions:

#### View Controller 1

```swift
greyView.motionIdentifier = "foo"
orangeView.motionIdentifier = "bar"
```

#### View Controller 2

```swift
isMotionEnabled = true
greyView.motionIdentifier = "foo"
orangeView.motionIdentifier = "bar"
orangeView.transition(.translate(x: -100))
```

The above code snippet tells the source views in `view controller 1` to link to the destination views in `view controller 2` using the `motionIdentifier`. Animations may be added to views during a transition using the **transition** method. The *transition* method accepts MotionTransition structs that configure the view's animation.

* [MotionTransition API](https://cosmicmind.gitbooks.io/motion/content/motion_transition_api.html)
* [Code Samples](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/TransitionsWithIdentifier)

## UINavigationController, UITabBarController, and UIViewController Transitions

Motion offers default transitions that may be used by UINavigationControllers, UITabBarControllers, and presenting UIViewControllers.

| Push                                                           | Slide                                                            | ZoomSlide                                                                  | Cover                                                            | Page                                                              | Fade                                                           | Zoom                                                           |
| -------------------------------------------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| ![Push](http://www.cosmicmind.com/motion/transitions/push.gif) | ![Slide](http://www.cosmicmind.com/motion/transitions/slide.gif) | ![Zoom Slide](http://www.cosmicmind.com/motion/transitions/zoom_slide.gif) | ![Cover](http://www.cosmicmind.com/motion/transitions/cover.gif) | ![Page](http://www.cosmicmind.com/motion/transitions/page_in.gif) | ![Fade](http://www.cosmicmind.com/motion/transitions/fade.gif) | ![Zoom](http://www.cosmicmind.com/motion/transitions/zoom.gif) |

### Example Usage

An example of transitioning from one view controller to another using a UINavigationController with a zoom transition:

#### UINavigationController

```swift
class AppNavigationController: UINavigationController {
    open override func viewDidLoad() {
        super.viewDidLoad()
        isMotionEnabled = true
        motionNavigationTransitionType = .zoom
    }
}
```

To add an automatic reverse transition, use `autoReverse`.

```swift
motionNavigationTransitionType = .autoReverse(presenting: .zoom)
```

* [Code Samples](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/Transitions)
