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

            self.imageCollectionView.contentOffset = contentOffSet

            }, completion: { (context) -> Void in
                //let desiredIndexPath = NSIndexPath(forItem: self.currentPage, inSection: 0)
                //self.imageCollectionView.reloadItemsAtIndexPaths([desiredIndexPath])
        })
        
        flowLayout.invalidateLayout()

        
        //currentPage = visibleIndexes.first?.item ?? 0

        currentPage = getCurrentPage()

        // If the scroll animation ended, update the page control to reflect the current page we are on
        pageControl.currentPage = currentPage
        println("currentPage: \(currentPage)")
