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
Swift 4:
For Horizontal Scrolling - .right
.right
For Vertical Scrolling - .bottom
.bottom
let lastItemIndex = self.collectionView.numberOfItems(inSection: 0) - 1 let indexPath:IndexPath = IndexPath(item: lastItemIndex, section: 0) self.collectionView.scrollToItem(at: indexPath, at: .right, animated: false)