<commit_before>//
//  ZoomTransition.swift
//  Transitions
//
//  Created by <NAME> on 2014-09-30.
//  Copyright (c) 2014 him. All rights reserved.
//

import Foundation
import UIKit

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

public class ZoomTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnimatedTransitioning, UINavigationControllerDelegate, UIGestureRecognizerDelegate {
    
    private var navigationController: UINavigationController
    private var fromView: UIView?
    private var toView: UIView?
    private var fromFrame: CGRect?
    private var toFrame: CGRect?
    private var transitionView: UIView?
    private var transitionContext: UIViewControllerContextTransitioning?
    private var fromViewController: UIViewController?
    private var toViewController: UIViewController?
    private var isPresenting: Bool = true
    private var shouldCompleteTransition: Bool = false
    private let completionThreshold: CGFloat = 0.7
    private var interactive: Bool = false
    
    var allowsInteractiveGesture = true
    
    init(navigationController: UINavigationController) {
        self.navigationController = navigationController
    }
    
    // MARK: - UIViewControllerAnimatedTransition Protocol
    
    public func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
        if interactive {
            return 0.7
        }
        
        return 0.5
    }
    
    public func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
        self.transitionContext = transitionContext
        fromViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey);
        toViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey);<commit_msg>made init function public<commit_after>//
//  ZoomTransition.swift
//  Transitions
//
//  Created by <NAME> on 2014-09-30.
//  Copyright (c) 2014 him. All rights reserved.
//

import Foundation
import UIKit

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

public class ZoomTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnimatedTransitioning, UINavigationControllerDelegate, UIGestureRecognizerDelegate {
    
    private var navigationController: UINavigationController
    private var fromView: UIView?
    private var toView: UIView?
    private var fromFrame: CGRect?
    private var toFrame: CGRect?
    private var transitionView: UIView?
    private var transitionContext: UIViewControllerContextTransitioning?
    private var fromViewController: UIViewController?
    private var toViewController: UIViewController?
    private var isPresenting: Bool = true
    private var shouldCompleteTransition: Bool = false
    private let completionThreshold: CGFloat = 0.7
    private var interactive: Bool = false
    
    var allowsInteractiveGesture = true
    
    public init(navigationController: UINavigationController) {
        self.navigationController = navigationController
    }
    
    // MARK: - UIViewControllerAnimatedTransition Protocol
    
    public func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
        if interactive {
            return 0.7
        }
        
        return 0.5
    }
    
    public func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
        self.transitionContext = transitionContext
        fromViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey);
        toViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey);
{'fraction_non_alphanumeric': 0.055806537337230934, 'fraction_numerical': 0.009566834972096731, 'mean_word_length': 3.946123521681997, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3085746', 'n_tokens_mistral': 969, 'n_tokens_neox': 888, 'n_words': 243}