SwiftReorder icon indicating copy to clipboard operation
SwiftReorder copied to clipboard

SwiftReorder blocks other UIGestureRecognizers in tableview cells

Open axiom-media opened this issue 6 years ago • 3 comments

I have a UITableView with custom cells. In each cell I have a thumbnail image and each thumbnail has a UIGestureRecognizer which responds to long presses and triggers a full screen overlay with a zoomed version of the thumbnail.

After implementing SwiftReorder, my cells are no longer responding to the long press on thumbnail images. Is there a way to have SwiftReorder ignore gestures if they happen on a thumbnail image and send those gestures to my pre-exiting UIGestureRecognizer instead?

axiom-media avatar Jun 07 '18 06:06 axiom-media

Update: I'm sure there is a better way to achieve this, but I was able to get the functionality back by ensuring the minimumPressDuration on my thumbnail image gesture recognizer was set to a lower value than the tableView.reorder.longPressDuration property for SwiftReorder.

axiom-media avatar Jun 07 '18 06:06 axiom-media

@axiom-media You can use the TableViewReorderDelegate. Implement the canReorderRowAt delegate method, and others as necessary. func tableView(_ tableView: UITableView, canReorderRowAt indexPath: IndexPath) -> Bool { //If it is a thumbnail cell, then return false }

costachung avatar Jun 14 '18 12:06 costachung

I am facing same problem, can you tell me how you resolved that issue. I am using grouped (like in Demo Example in this project) like UITableview and there are button in Cell, I am unable to perform button click. Can you tell how to achieve this?

AndroidJohnDoe avatar Jan 11 '19 04:01 AndroidJohnDoe