Skip to content

Custom interactive view controller transition from one view to another view.

License

Notifications You must be signed in to change notification settings

a2/View2ViewTransition

 
 

Repository files navigation

View2ViewTransition

Simple framework for custom interactive viewController transition from one view to another view.

installation

Carthage

github "naru-jpn/View2ViewTransition"

CocoaPods

pod 'View2ViewTransition'

Usage

Create TransitionController and implement presentation

// Create TransitionController
var transitionController: TransitionController = TransitionController()

// ...

// Present view controller with transition delegate
let presentedViewController: PresentedViewController = PresentedViewController()
presentedViewController.transitioningDelegate = transitionController

transitionController.present(viewController: presentedViewController, on: self, attached: presentedViewController, completion: nil)

Presenting viewController conforms View2ViewTransitionPresenting

func initialFrame(userInfo: [String: AnyObject]?, isPresenting: Bool) -> CGRect
func initialView(userInfo: [String: AnyObject]?, isPresenting: Bool) -> UIView
func prepereInitialView(userInfo: [String: AnyObject]?, isPresenting: Bool) -> Void // (optional)

Presented viewController conforms View2ViewTransitionPresented

func destinationFrame(userInfo: [String: AnyObject]?, isPresenting: Bool) -> CGRect
func destinationView(userInfo: [String: AnyObject]?, isPresenting: Bool) -> UIView
func prepareDestinationView(userInfo: [String: AnyObject]?, isPresenting: Bool) -> Void // (optional)

Use UserInfo

You can set userInfo to notify indexPath or share resource etc.

transitionController.userInfo = ["key": "value", ...]

Example

View2ViewTransitionExample

About

Custom interactive view controller transition from one view to another view.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 96.8%
  • Ruby 1.7%
  • Objective-C 1.5%