I would like to scroll the UICollectionView to the bottom so the last item is in the view. I have tried to use scrollToItemAtIndexPath but it does not seem to be working. I want
For Swift 3 and multiple sections
/**
This method scrolls the *UICollectionView* to the last item in the last section
*/
func scrollToLastItem() {
let lastSection = collectionView.numberOfSections - 1
let lastRow = collectionView.numberOfItems(inSection: lastSection)
let indexPath = IndexPath(row: lastRow - 1, section: lastSection)
self.collectionView.scrollToItem(at: indexPath, at: .right, animated: true)
}