Skip to content

dev-aleksey/ScaleTransition

Repository files navigation

ScaleTransition

Custom modal transition animation

Animation

Requirements

  • iOS 8.0+
  • Xcode 7.2

Installation

Just add the ScaleTransition.swift file to your project.

or use CocoaPods with Podfile:

pod 'ScaleTransition', '~> 1.0.3'

Usage

// create viewcontroller
let storyboard = UIStoryboard(storyboard: .Main)
let detail: DetailViewController = storyboard.instantiateViewController()

// configure transition    
detail.transitioningDelegate = self
detail.modalPresentationStyle = .Custom

// present viewController    
navigationController?.presentViewController(detail, animated: true, completion: nil)
// MARK: transition delegate
extension ViewController: UIViewControllerTransitioningDelegate {

  func animationControllerForPresentedController(presented: UIViewController,
                           presentingController presenting: UIViewController,
                                   sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {

    return ScaleShowTransition(duration: 0.5, scale: 0.9)
  }


  func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    return ScaleHideTransition(duration: 0.5, scale: 0.9)
  }
}

Licence

ScaleTransition is released under the MIT license. See LICENSE for details.

About

If you have any questions, you can write me dev.aleksey@yandex.ru

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •