         let topInset = topView.frame.height + 20.0
         scrollView.contentInset = UIEdgeInsets(top: topInset, left: 0, bottom: 0, right: 0)
         scrollView.setContentOffset( CGPoint(x: 0.0, y: -scrollView.contentInset.top), animated: false)
+        lastOffset = scrollView.contentOffset.y
+        scrollView.delegate = self
     }
     
     override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

    private var itemCenter: CGPoint!
    private var selectedItem: MainItemView!
    
    @IBOutlet weak private var topView: UIVisualEffectView!
    @IBOutlet weak private var scrollView: UIScrollView!
    


    }
}
// MARK: UIScrollViewDelegate
extension MainViewController: UIScrollViewDelegate{
    func scrollViewDidScroll(scrollView: UIScrollView) {
        
        //update UIKit Dynamic
        let delta = scrollView.contentOffset.y - lastOffset
        for behavior in animator.behaviors{
            let spring = behavior as! UIAttachmentBehavior
            let yDistance = scrollView.contentOffset.y - spring.anchorPoint.y
            let scrollResistance = yDistance / 1500.0
            
            let item = spring.items.first as! UIDynamicItem
            var center = item.center
            center.y += delta
            if (delta < 0) {
                center.y += max(delta, delta*scrollResistance);
            }else {
                center.y += min(delta, delta*scrollResistance);
            }
            item.center = center
            animator.updateItemUsingCurrentState(item)
        }
        lastOffset = scrollView.contentOffset.y
    }
    
}
// MARK: UIViewControllerTransitioningDelegate
extension MainViewController: UIViewControllerTransitioningDelegate{
    func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
