     }
 
 }
+
+extension SplitTransition: UIGestureRecognizerDelegate {
+
+    public func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer) -> Bool {
+        let location = gestureRecognizer.locationInView(container)
+        let presentationLayer = container?.layer.presentationLayer()
+
+        if ((presentationLayer?.hitTest(location)) != nil) {
+            return true
+        }
+        return false
+    }
+    
+}
+
+extension SplitTransition: UIViewControllerTransitioningDelegate {
+    
+    public func interactionControllerForPresentation(animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
+        return interactive ? self : nil
+    }
+    
+    public func interactionControllerForDismissal(animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
+        return interactive ? self : nil
+    }
+    
+}


    public func animateTransition(transitionContext: UIViewControllerContextTransitioning) {

        // Take screenshot and store resulting UIImage
        screenCapture = UIWindow.screenShot()

        // Grab the view in which the transition should take place.
        // Coalesce to UIView()
        let container = containerView(transitionContext) ?? UIView()

        // Set source and destination view controllers
        let fromVC = fromViewController(transitionContext) ?? UIViewController()
        let toVC = toViewController(transitionContext) ?? UIViewController()

        // Set completion handler for transition
        let completion = {transitionContext.completeTransition(!transitionContext.transitionWasCancelled())}

        switch transitionType {
        case .Push:
            push(toVC, fromViewController: fromVC, containerView: container, completion: completion)
            break
        case .Pop:
            pop(toVC, fromViewController: fromVC, containerView: container, completion: completion)
            break
        }
    }

}

// MARK: - Private

private extension SplitTransition {

    // Returns the view controller being navigated away from
    func fromViewController(transitionContext: UIViewControllerContextTransitioning?) -> UIViewController? {

        return imageView
    }()

    public var sourceViewController: UIViewController?
    public var interactive: Bool = true
    private var canScrollToZero: Bool = false
    private var transitionProgress: CGFloat = 0.0
    private var gestureRecognizer: UIPanGestureRecognizer?
    private var transitionContext: UIViewControllerContextTransitioning?
    private var previousTouchLocation: CGPoint = CGPointZero
    private var container: UIView?
    private var toVC: UIViewController?
    private var fromVC: UIViewController?
    private var completion: (() -> ())?

    /**
     * Screen capture extending from split location
     * to bottom of screen
