Skip to content

movingHorizontally BOOL problem #16

@pavel-krusek

Description

@pavel-krusek

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions