HHPanningTableViewCell icon indicating copy to clipboard operation
HHPanningTableViewCell copied to clipboard

Drawer View being shown at random on refresh/delete

Open georgemp opened this issue 10 years ago • 4 comments

Hi, I've been trying to track down the issue on this for a while, but, have been pretty unsuccessful. In my app, the drawer view shows up at random on refreshing/deleting cells from the tableview. I have modified the bundled demo app on a fork to demonstrate the problem. https://github.com/georgemp/HHPanningTableViewCell/tree/drawerIssues This demo app in this case allows refresh. But, if you refresh (might have to do it a few times), sometimes the new cell is displayed with the drawerView show. I would appreciate any ideas on how to prevent this. Thanks

georgemp avatar Apr 11 '14 10:04 georgemp

Since, it takes a while to reproduce, I've created a small video demonstrating the issue http://youtu.be/EIsc71BgPpA

Thanks

georgemp avatar Apr 11 '14 10:04 georgemp

Hi!

It appears the problem is in the gesture recognizer.

On occasion, a pan is accidentally initiated when you try to pull to refresh. gestureRecognizerDidPan: installs the subviews on gesture begin and does not remove these on cancel.

I am not quite sure why of if this behavior is needed.

One way to fix the problem would be to make sure the scroll view's gesture recognizer has priority over our pan gesture recognizer.

Another way would be to modify gestureRecognizerDidPan: like this:

if (state == UIGestureRecognizerStateBegan) {
…
}
else if (state == UIGestureRecognizerStateEnded) {
…
}
else if (state == UIGestureRecognizerStateCancelled) {
    [self.drawerView removeFromSuperview];
    [self.shadowView removeFromSuperview];

    self.panningInProgress  = NO;
}

Please send in a pull request if you fix this problem.

Pierre

On 11 Apr 2014, at 12:50, georgemp [email protected] wrote:

Since, it takes a while to reproduce, I've created a small video demonstrating the issue http://youtu.be/EIsc71BgPpA

Thanks

— Reply to this email directly or view it on GitHub.

gloubibou avatar Apr 11 '14 11:04 gloubibou

I have the same issue. For me it is VERY regular: Whenever I reload table with different cells than HHPanningTableViewCell and one of HHPanningTableViewCell's drawer view was reveal - it will stay in the table view:

  1. BEFORE RELOAD (with 1 drawer revealed): img_1200
  2. AFTER RELOAD (with new cell types - not HHPanningTableViewCells): img_1199

lukaszmargielewski avatar Jun 02 '14 12:06 lukaszmargielewski

The problem reported by georgemp originated from the fact that the swipe gesture recognizer could be accidentally triggered by a pull-to-refresh gesture.

I believed this had been fixed by pull request #36. Please try that version.

Please also try the prior version and apply the fix described in my (oddly formatted) comment from Apr 11.

If neither fixes the issue, you are looking at different problem. Please verify that translation values are reset when cells get reused.

gloubibou avatar Jun 02 '14 12:06 gloubibou