In the video Advances in Collection View Layout - WWDC 2019, Apple introduces a new 'orthogonal scrolling behavior' feature. I have a view controller almost identical to OrthogonalScrollingViewController
in their example code. In particular my collection view is laid out vertically, and each section can scroll horizontally (I use section.orthogonalScrollingBehavior = .groupPaging
).
I want to have all my sections scroll horizontally in unison. Previously, I listened for scrollViewDidScroll
on each horizontal collection view, then manually set the content offset of the others. However, with the new orthogonalScrollingBehavior
implementation, scrollViewDidScroll
never gets called on the delegate when I scroll horizontally. How can I detect horizontal scrolling events with the new API?
If there's another way to make the sections scroll together horizontally, I'm also open to other suggestions.