Scroll to the Bottom of a Collection View

private func scrollToBottom() {
    let lastSectionIndex = (collectionView?.numberOfSections())! - 1
    let lastItemIndex = (collectionView?.numberOfItemsInSection(lastSectionIndex))! - 1
    let indexPath = NSIndexPath(forItem: lastItemIndex, inSection: lastSectionIndex)
       
    collectionView!.scrollToItemAtIndexPath(indexPath, atScrollPosition: UICollectionViewScrollPosition.Bottom, animated: false)
}

 

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.