             
             UIView.addKeyframeWithRelativeStartTime(0.0, relativeDuration: 0.3, animations: { () -> Void in
                 snapshot.frame = containerView.convertRect(firstRect, fromView: fromCollectionView)
+                lineView.frame = self.lineViewFrameWithBounds(snapshot.bounds)
             })
             
             UIView.addKeyframeWithRelativeStartTime(0.3, relativeDuration: 0.3, animations: { () -> Void in
                 snapshot.frame = secondRect
+                lineView.frame = self.lineViewFrameWithBounds(snapshot.bounds)
             })
             
             UIView.addKeyframeWithRelativeStartTime(0.6, relativeDuration: 0.3, animations: { () -> Void in

        
        guard let toCollectionView = toViewController.collectionView else { return }
        guard let fromCollectionView = fromViewController.collectionView else { return }
        
        guard let containerView = transitionContext.containerView() else { return }
        
        // Find origin rect
        guard let originIndexPath = fromCollectionView.indexPathsForVisibleItems().first else { return }
        let originAttributes = fromCollectionView.layoutAttributesForItemAtIndexPath(originIndexPath)
        let originRect = CGRectInset(originAttributes!.frame, 0.0, 0.0)
        let snapshotRect = CGRectMake(originRect.origin.x, originRect.origin.y, originRect.size.width, 64.0)
        
        // Find destination rect
        let destinationAttributes = toCollectionView.layoutAttributesForItemAtIndexPath(originIndexPath)
        var destinationRect = destinationAttributes!.frame
        
        // XXXAJS: Offset destination rect by navigation bar height
        // why does a convertRect not take care of this?
        // doing a convertRect to containerView space makes a weird rectangle
        destinationRect = CGRectMake(destinationRect.origin.x, destinationRect.origin.y + 64.0, destinationRect.size.width, destinationRect.size.height)
        
        let firstRect = CGRectMake(originRect.origin.x, originRect.origin.y, originRect.size.width, destinationRect.size.height)
        let secondRect = destinationRect
        
        let insets = UIEdgeInsets(top: 73.0, left: 0.0, bottom: 1.0, right: 0.0)
        let snapshot = fromCollectionView.resizableSnapshotViewFromRect(snapshotRect, afterScreenUpdates: false, withCapInsets: insets)
        snapshot.frame = containerView.convertRect(originRect, fromView: fromCollectionView)
        
        containerView.addSubview(toViewController.view)
        containerView.addSubview(snapshot)

import UIKit

class HideDetailAnimator: NSObject, UIViewControllerAnimatedTransitioning {
    
    private let duration = 0.75
    
    func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
