         imageView.setTranslatesAutoresizingMaskIntoConstraints(false)
         scrollView = UIScrollView(frame: frame)
         scrollView.setTranslatesAutoresizingMaskIntoConstraints(false)
+        scrollView.contentSize = CGSizeMake(50, 50)
 
         super.init(frame: frame)
 




//    override public func viewWillLayoutSubviews() {
//        super.viewWillLayoutSubviews()
//
//        pageBeforeRotation = currentPage
//
//        let nextPageIndexPath = NSIndexPath(forItem: pageBeforeRotation + 1, inSection: 0)

            self.imageCollectionView.contentOffset = contentOffSet

            }, completion: { (context) -> Void in
                self.imageCollectionView.reloadData()
        })
        
        flowLayout.invalidateLayout()
