Reputation: 777
I have a UICollectionViewController and each of my UICollectionViewCells contains a subview WKWebView. I am trying to implement the installsStandardGestureForInteractiveMovement = true so I can re-order the cells. I have implemented the
collectionView(collectionView: UICollectionView, moveItemAtIndexPath sourceIndexPath: NSIndexPath, toIndexPath destinationIndexPath: NSIndexPath)
But it seems the WKWebView is intercepting the long press. How can I fix this so that it is ignored on the WKWebView so re-ording works as expected?
Thanks,
Rob
Upvotes: 0
Views: 873
Reputation: 6030
WKWebView
has its own long-press recognizers which can intercept long-press gesture on the cell.
To fix this, you can add into the cell a transparent view covering the web view. If you need to have also interaction on the web view working, you will need to implement collection view re-ordering interaction by yourself with methods:
- beginInteractiveMovementForItemAtIndexPath:
- updateInteractiveMovementTargetPosition:
- endInteractiveMovement
- cancelInteractiveMovement
Upvotes: 0