Do UICollectionView scroll from right to left?

The natural direction for scrolling a UICollectionView in horizontal position from left to right. Is there any way to undo this? The simpler the better.

+4
source share
2 answers

I'm not sure exactly what you mean - if you set the scroll to the horizontal position, it scrolls equally well, left and right. If you want to run it from the right side, you can use this method:

[self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:self.theData.count - 1 inSection:0] atScrollPosition:UICollectionViewScrollPositionRight animated:NO]; 

It is assumed that you have 1 section, and the array populating the collection view is called Data.

+9
source

Same for quick:

 collectionView?.scrollToItemAtIndexPath(NSIndexPath(forItem: theData.count - 1, inSection: 0), atScrollPosition: .Right, animated: false) 
+1
source

All Articles