Add Pan Gesture to UICollectionView Cell - IOS/Swift
<p>I have an UICollectionView and I want to add pan gesture to its Cells/Items. When I add the gesture in usual way UICollectionView is not getting scrolled. </p>

<p>This is how I add the gesture</p>

<pre><code>func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {

    let cell:UICollectionViewCell = collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath)

    let panGesture = UIPanGestureRecognizer(target: self, action: #selector(CaptureViewController.pagesCollectionViewItemPanEvent(_:)))
    cell.addGestureRecognizer(panGesture)

    return cell;
}
</code></pre>

<p>Is there something wrong here? Can someone please tell me a way to get my work done. Any help would be highly appreciated. </p>