https://github.com/tristanhimmelman/ZoomTransition
Interactive zoom transition for presenting view controllers written in Swift
https://github.com/tristanhimmelman/ZoomTransition
Last synced: 19 days ago
JSON representation
Interactive zoom transition for presenting view controllers written in Swift
- Host: GitHub
- URL: https://github.com/tristanhimmelman/ZoomTransition
- Owner: tristanhimmelman
- License: mit
- Created: 2014-10-06T14:53:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-06-08T21:10:18.000Z (almost 3 years ago)
- Last Synced: 2025-03-31T17:19:55.471Z (23 days ago)
- Language: Swift
- Homepage:
- Size: 4.22 MB
- Stars: 273
- Watchers: 12
- Forks: 29
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - ZoomTransition - Interactive zoom transition for presenting view controllers written in Swift (etc)
- awesome - ZoomTransition - Interactive zoom transition for presenting view controllers written in Swift (etc)
README
ZoomTransition
==============
[](https://github.com/tristanhimmelman/ZoomTransition)
[](https://github.com/Carthage/Carthage)An easy to use interactive zoom transition for presenting view controllers onto a navigation stack. This transition mimics the iOS 7 & 8 photos app.
ZoomTransition supports pinch, rotate and pan gestures while dismissing the presented view controller.

To use the transition in your app, simply create a ZoomTransition object by passing in the current NavigationController.
Then set the ZoomTransition object to be the NavigationControllers delegate
```swift
if let navigationController = self.navigationController {
self.animationController = ZoomTransition(navigationController: navigationController)
}
self.navigationController?.delegate = animationController// present view controller
let imageViewController = ImageViewController(nibName: "ImageViewController", bundle: nil)
self.navigationController?.pushViewController(imageViewController, animated: true)
```Finally, you must implement the ZoomTransistionProtocol on both the presenting and the presented view controllers so the ZoomTransition knows which views to transition between
```swift
func viewForTransition() -> UIView {
return imageView
}
```#Installation
ZoomTransition can be easily added to your project using [CocoaPods](https://cocoapods.org/) by adding the following to your Podfile:
`pod 'ZoomTransition', '~> 0.3'`
Otherwise you can include ZoomTransition.swift directly to your project.