 		collectionView.setContentOffset(proposedContentOffset, animated: shouldAnimate)
 	}
 	
+	/// Calculates the current centered page.
 	public var currentCenteredPage: Int? {
 		guard let collectionView = collectionView else { return nil }
 		let currentCenteredPoint = CGPoint(x: collectionView.contentOffset.x + collectionView.bounds.width/2, y: collectionView.contentOffset.y + collectionView.bounds.height/2)

		}
	}
	
	public func scrollToPage(index: Int, animated: Bool) {
		guard let collectionView = collectionView else { return }
		

	override open func invalidateLayout(with context: UICollectionViewLayoutInvalidationContext) {
		super.invalidateLayout(with: context)
		guard let collectionView = collectionView else { return }

		// invalidate layout to center first and last
		let currentCollectionViewSize = collectionView.bounds.size
		if !currentCollectionViewSize.equalTo(lastCollectionViewSize) || lastScrollDirection != scrollDirection {
			let inset: CGFloat
