Skip to content

Commit

Permalink
- made zoom transition a public class so it can be used with cocoa pods
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanhimmelman committed May 2, 2015
1 parent 7c87589 commit 19fea99
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ZoomTransition/ZoomTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import Foundation
import UIKit

@objc protocol ZoomTransitionProtocol {
@objc public protocol ZoomTransitionProtocol {
func viewForTransition() -> UIView
}

class ZoomTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnimatedTransitioning, UINavigationControllerDelegate, UIGestureRecognizerDelegate {
public class ZoomTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnimatedTransitioning, UINavigationControllerDelegate, UIGestureRecognizerDelegate {

private var navigationController: UINavigationController
private var fromView: UIView?
Expand All @@ -37,15 +37,15 @@ class ZoomTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnim

// MARK: - UIViewControllerAnimatedTransition Protocol

func transitionDuration(transitionContext: UIViewControllerContextTransitioning) -> NSTimeInterval {
public func transitionDuration(transitionContext: UIViewControllerContextTransitioning) -> NSTimeInterval {
if interactive {
return 0.7
}

return 0.5
}

func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
public func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
self.transitionContext = transitionContext
fromViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey);
toViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey);
Expand Down Expand Up @@ -295,7 +295,7 @@ class ZoomTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnim

// MARK: - UINavigationControllerDelegate

func navigationController(navigationController: UINavigationController, animationControllerForOperation operation: UINavigationControllerOperation, fromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
public func navigationController(navigationController: UINavigationController, animationControllerForOperation operation: UINavigationControllerOperation, fromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {

if (fromVC.conformsToProtocol(ZoomTransitionProtocol) && toVC.conformsToProtocol(ZoomTransitionProtocol)){
return self
Expand All @@ -304,7 +304,7 @@ class ZoomTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnim
return nil;
}

func navigationController(navigationController: UINavigationController, interactionControllerForAnimationController animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
public func navigationController(navigationController: UINavigationController, interactionControllerForAnimationController animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {

if (self.interactive){
return self
Expand All @@ -315,7 +315,7 @@ class ZoomTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnim

// MARK: - UIGestureRecognizerDelegate

func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
public func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}

0 comments on commit 19fea99

Please sign in to comment.