         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?) {


    }
}

// MARK: UIViewControllerTransitioningDelegate
extension MainViewController: UIViewControllerTransitioningDelegate{
    func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {

    private var itemCenter: CGPoint!
    private var selectedItem: MainItemView!
    
    private var itemRows: [ [MainItemView] ] = []
    private var animator: UIDynamicAnimator!
    
    private var lastOffset: CGFloat = 0.0 //for calculate scrollView's delta offset
    
    @IBOutlet weak private var topView: UIVisualEffectView!
    @IBOutlet weak private var scrollView: UIScrollView!
    
