5

The UICollectionView disables scrolling by default when there is not enough cells in the view. When this occurs I need it to bounce back to position when pulled. Im am aware of a hack where I can fill the UICollectionView with empty tables to enable scrolling but I was hoping there would be a slightly more fluid example as

I don't want the view to scroll but instead to automatically bounce back to its position. This is because of the effect I have implemented below as can see below.

https://youtu.be/r75xB9-Mb4g

Is there a way to achieve this simply, when there is not enough cells in the UICollectionView the scroll is disabled.

bivo
  • 100
  • 1
  • 2
  • 15
memyselfandmyiphone
  • 1,080
  • 4
  • 21
  • 43

1 Answers1

15

For vertical scrolling:

self.collectionView.alwaysBounceVertical = true;

For horizontal scrolling:

self.collectionView.alwaysBounceHorizontal = true;
Jake Chasan
  • 6,290
  • 9
  • 44
  • 90
Vaibhav Jhaveri
  • 1,579
  • 3
  • 28
  • 53