Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 7: Dragging in UITableView / delaysContentTouches seems not working

I have an iPad App with draggable content in a UITableView...The tableView is scrollable horizontally and full of dragable images (subclass of UIImageView with overwritten touchesBegan: etc.)

Till iOS 7 the tableView.delaysContentTouch=YES; of the UITableView works as expected and the app was able to differentiate between a horizontal scrolling in the tableView (fast movement with the finger over the tableview) and dragging of an element inside the tableviews contentView (hold finger a second on the draggable till the tableview forwards the touch to touchesBegan: of the UIImageView subclass in the contentView.

Now under iOS 7 scrolling is nearly impossible, because the dragging of the content immediately fires. Code wasn't changed.

Anybody expierenced something similar and found a solution?

Thanks in advance!

like image 287
Jones123 Avatar asked Sep 30 '13 11:09

Jones123


1 Answers

delaysContentTouches is not working in iOS7 and 7.02, this seems to be a bug, you can use touchesBegan and touchesCancelled (which is sent if the user scrolls) as a workaround to handle your touchEvents the right way.

like image 118
lowrezz Avatar answered Oct 10 '22 09:10

lowrezz