Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot swipe UITableViewCell to expose delete button when using PaperFold #68

Open
seenickcode opened this issue Oct 18, 2013 · 2 comments

Comments

@seenickcode
Copy link

Hello. I have a table view controller working fine with the ability to swipe the row and expose a Delete button in iOS 7. But if I use this library, I can no longer swipe the row unless it's starting from beyond the edge of the screen.

Here is how I setup my components. My 'leftViewController' and 'rightViewController' are both PaperFoldNavigationControllers since they each require a navigation controller as their root view controller.

    kAppDelegate.paperFoldNavController = [[PaperFoldNavigationController alloc] initWithRootViewController:self.navigationController];
    kAppDelegate.paperFoldNavController.paperFoldView.backgroundColor = [UIColor blackColor];
    kAppDelegate.paperFoldNavController.paperFoldView.enableLeftFoldDragging = NO; // enabled after login
    [kAppDelegate.window setRootViewController:kAppDelegate.paperFoldNavController];

    // setup menu panel for left paper fold vc
    kAppDelegate.menuPanel = [[SDMenuPanelVC alloc] init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:kAppDelegate.menuPanel];
    [nav setNavigationBarHidden:YES];
    PaperFoldNavigationController *menuNav = [[PaperFoldNavigationController alloc] initWithRootViewController:nav];
    [kAppDelegate.paperFoldNavController setLeftViewController:menuNav width:255];
@seenickcode
Copy link
Author

Note that I think this is the cause for the problem. The gesture doesn't get disabled or removed if you set 'enableLeftFoldDragging' to NO

// PaperFoldView.h

UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(onContentViewPanned:)];
[_contentView addGestureRecognizer:panGestureRecognizer];

@seenickcode
Copy link
Author

My temporary fix. Let me know what you think:

// PaperFoldView.m

@interface PaperFoldView ()
@property (nonatomic, strong) UIPanGestureRecognizer *panGestureRecognizer;
@end

...

self.panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(onContentViewPanned:)];
[_contentView addGestureRecognizer:self.panGestureRecognizer];

...

- (void)setEnableLeftFoldDragging:(BOOL)enableLeftFoldDragging
{
    _enableLeftFoldDragging = enableLeftFoldDragging;

    self.panGestureRecognizer.enabled = _enableLeftFoldDragging;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant