Shwet Solanki
Shwet Solanki

Reputation: 345

Two Gestures getting recognized simultaneously

I have two collectionview positioned one below the another, something similar to Skype Like Navigation (kindly check the latest Skype iPhone App). The Complete structure has been working fine along with the parallax scrolling of the header view. Check it at Skype Like Navigation Github

In the app if you see, when you scroll the Content CollectionView, the top header view also scrolls depending on the header cell size. And when the Header CollectionView is scrolled, the Content CollectionView also scrolls.

I have written all the calculation for the Content Collection View scrolled by user, and in order to get the desired working when the user scrolls the Header Collection View, I have added the Pan Gesture of ContentCollectionView to the Header Collection View and it just worked fine.

But there is a side effect to it, my Content Collection Cell contains a UITableView, now when I try to scroll the tableview and if my finger moves slight right or left, the Content Collection View also scrolls (FYI, UITableView is vertical scrolling and UICollectionView is Horizontal Scrolling).

I believe adding the Pan Gesture to Header CollectionView has messed up the scrolling.

So if anyone knows the fix, do let me know.

Demo : Skype Like Navigation Demo

Thanks

Upvotes: 0

Views: 647

Answers (1)

gallileo
gallileo

Reputation: 462

Ok I have it now. The simple gist of it is, that you disable scrolling on your collectionviews when the table view scrolls.

For further information please see my pull request on Github.

Upvotes: 0

Related Questions