1

When using UICollectionViewCompositionalLayout with horizontal and vertical scrolling,

how do i get the corresponding UISCrollView from UICollectionView

to automatically scroll a given section (setContentOffset) by timer

eg. so only ONE section is automatically scrolled, not the whole collectionView

Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179

1 Answers1

0

Right after I posted my comment, I realized that there is a scrollToItem:at:at:animated: method on UICollectionView. At least it works for me, but I only have one orthogonal section in my collection view.

I am not sure if that’s what you want (scrolling to a specific index path) or if you want to scroll a specific section to a specific offset without an index path.

Note: There seems to be a bug with iOS 14. Trying to scroll to the index path that is just before the current visible one actually scrolls one further. In iOS 13.X it works as expected.