CocoaPods trunk is moving to be read-only. Read more on the blog, there are 7 months to go.

ScaleTransition 1.0.3

ScaleTransition 1.0.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release May 2016
SPMSupports SPM

Maintained by dev-alex.



  • By
  • Alex

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.2'

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 [email protected]