         if collectionViewSize != collectionView?.bounds.size {
             collectionViewSize = collectionView?.bounds.size
             collectionView?.reloadData()
+            updatePageControl()
         }
     }
     

    var pageCount: Int {
        return cellIdentifiers?.count ?? 0
    }
    
    // MARK: - Constants
    

                                                animated: animated)
    }
    
    private func updatePageControl() {
        pageControl.frame.origin.x = (collectionView!.bounds.width - pageControl.frame.width) / 2 + collectionView!.contentOffset.x
        pageControl.frame.origin.y = collectionView!.bounds.height - pageControl.frame.height + collectionView!.contentOffset.y - controlInsetBottom
        pageControl.currentPage = loopedPageForPage(page + 1)
    }
    
    // MARK: - Functions
    
    private func loopedPageForPage(page: Int) -> Int {
        let loopedPage = page % pageCount
        return loopedPage >= 0 ? loopedPage : pageCount + loopedPage
    }
    
    // MARK: - UIViewController
