designatednerd / DNSSwipeableTableCell

UITableViewCell subclass to add multiple buttons to a swipe-under menu like iOS 7 Mail.
MIT License
175 stars 24 forks source link

movingHorizontally BOOL problem #16

Closed pavel-krusek closed 9 years ago

pavel-krusek commented 9 years ago

Translation is often == (0,0), so it's not precise - cell sometimes not move. The (0,0) problem is not apparent when velocityInView: is used instead of translationInView.

Current code: CGPoint currentPoint = [recognizer translationInView:self.myContentView]; //Check what direction the swipe is moving by checking the translation BOOL movingHorizontally = fabsf(self.panStartPoint.y) < fabsf(self.panStartPoint.x);

Fix: CGPoint movePoint = [recognizer velocityInView:self.myContentView]; BOOL movingHorizontally = fabsf(movePoint.y) < fabsf(movePoint.x);

spinyH commented 9 years ago

That is brilliant, thanks - amazing timing - I found I had a problem with this last night and settled down this morning to find a solution, and here it is, you've fixed it!

designatednerd commented 9 years ago

Cool, I'll throw this on the pile of bugs I need to address when I have time (at the current rate sometime in 2037 :stuck_out_tongue_closed_eyes:)

designatednerd commented 9 years ago

Addressed in v1.2.0.

designatednerd commented 9 years ago

Addressed in v1.2.0