0

I need to disable horizontal scrolling to only the left in my collection view. I know disabling horizontal/vertical scrolling completely is easy, but how do I disable only left scrolling, while still allowing for scrolling to the right.

Situation: I have a collection view with 40 cells. Only 1 cell is visible at a time--centered in the view, however, you can scroll to the right to see remaining cells. Every minute, a method is called that moves to the next cell (i.e. Cell A is centered in the view, and after a minute, Cell B is centered in the view). I want the user to see remaining cells, but not previous cells.

1st Cell

2nd Cell -> Don't allow user to go back to see 1st Cell

Here was my basic mindset of what I was trying, but haven't been able to get very far:

    if (self.summaryCollectionView.contentOffset.y < 0) {
        self.summaryCollectionView.scrollEnabled = NO;
    } else {
        self.summaryCollectionView.scrollEnabled = YES;
    }
Paul K.
  • 51
  • 1
  • 5
  • https://developer.apple.com/reference/uikit/uiscrollview/1619390-isdirectionallockenabled Could this property be what you're looking for? – tww0003 Jan 25 '17 at 20:18
  • Possible duplicate of [UIScrollView disable scrolling in just one direction?](http://stackoverflow.com/questions/5370428/uiscrollview-disable-scrolling-in-just-one-direction) –  Jan 30 '17 at 06:38

0 Answers0