Skip to content

Interactive zoom transition for presenting view controllers written in Swift

License

Notifications You must be signed in to change notification settings

UIKit0/ZoomTransition

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZoomTransition

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.

Screenshot

To add to your app, simply create a ZoomTransition by passing the current NavigationController Then set the ZoomTransition object be the NavigationController delegate

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

func viewForTransition() -> UIView {
	return imageView
}

About

Interactive zoom transition for presenting view controllers written in Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%