I have a collectionview with a grid of cells that is 3 wide by 3 tall. I have paging enabled to scroll horizontally to see the next page of 9 cells. However, I don't have a full 9 cells for the last page, only 3 remaining cells. The paging only scrolls to the first column of cells and it looks bad. I want it to scroll fully to the third page so it displays the 3 remaining cells in the first column and and 6 empty ones in the second 2 columns. Any help is greatly appreciated! Here is the paging code I have, thanks in advance!
func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
// sets which page we are currently on
let pageWidth:CGFloat = collectionView.frame.size.width
let currentPage:CGFloat = collectionView.contentOffset.x / pageWidth
// sets the page control to the current page
pageControl.currentPage = Int(currentPage)
}