Frage

I've added a swipe gesture recognizer to a UICollectionView on storyboard, with a Navigation Controller set up. I'm following this tutorial, except I'm using an UICollectionView for the first view.

Flow of storyboard

The actual problem is that when I run the program, and I try to swipe, nothing happens. Everything else happens.

I have tried following the directions over and over and in different ways, but nothing seems to work. I've created another project and just using regular view, it worked fine, which makes me think that the UICollectionView is part of the problem. Am I putting the gesture recognizer in the wrong view? I've tried putting it in the UIView of the first View Controller and in the UICollectionView, but it doesn't work.

What am I doing wrong? Clearly, if I left any information out or you need any information at all, please don't hesitate to ask in the comments for it.

EDIT: The connections of the swipe:

enter image description here

Keine korrekte Lösung

Andere Tipps

  1. Did you have define in storyboard, the segue from swipe gesture to next viewController ?
  2. did you swipe in the correct direction (this can be set in storybord, select your swipe, attributes inspector, Right / Left / UP / Down

The UICollectionView Is probably taking the gesture over and telling the controller that It cannot handle the collection view gesture and your swipe gesture at the same time. Implement the UIGestureRecognizerDelegate protocol and return YES in this delegate method - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer. Make sure that the delegate of the swipe gesture is set on the controller from the storyboard.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top