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 5 & 4 Just Call this Function when you want to display the last cell of collectionview
//MARK:- Collection view Scroll to End
func funColvScrollToEnd()
{
let item = self.collectionView(self.colv!, numberOfItemsInSection: 0) - 1
let lastItemIndex = NSIndexPath(item: item, section: 0)
self.colv?.scrollToItem(at: lastItemIndex as IndexPath, at: .bottom, animated: false)
}
//MARK:- You can use .right/ .left/ .top/ .bottom