2

I've got 2 (circular) UICollectionviews in my view, both are functioning but I want to use 1 swipe gesture for both views so when I swipe on the top collectionview, the bottom view should also swipe with the same speed and vice-versa. What would be the best way to achieve this?

This is my UIViewController: 2 Circular collectionviews

both collectionviews should scroll whenever I scroll anywhere on this UIViewController. Any help would be very appreciated.

Steven B.
  • 1,429
  • 2
  • 19
  • 38

1 Answers1

3

Set scrollView delegate of your collectionView's scrollView. UICollectionView is a subclass of UIScrollView. Use scrollViewDidScroll method. In that method you can for example see contentOffset of one UICollectionView and then set contentOffset to the other collectionView's scrollView to that value.

Flipper
  • 1,107
  • 1
  • 11
  • 32
  • ScrollViewDidScroll will only be called when the scrolling is done, I need a func that's called constantly while scrolling to keep it moving smooth at the same time. Also I can not override the scrollView or it's delegate of my UICollectionview :( – Steven B. May 19 '16 at 15:02
  • Did you ever find an answer that works for you? Thanks! – Emin Israfil iOS Jan 13 '18 at 02:42