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

PaperFold an UITableViewCell #67

Open
JeanetteMueller opened this issue Oct 7, 2013 · 2 comments
Open

PaperFold an UITableViewCell #67

JeanetteMueller opened this issue Oct 7, 2013 · 2 comments

Comments

@JeanetteMueller
Copy link

Hi,
i want to use paperfold on a cell, but if i do so, i cant scroll the table.
what's the best way to check draging and swiping?

my code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

NSString *cellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];

PaperFoldView *pv = [[PaperFoldView alloc] initWithFrame:CGRectMake(0, 0, 320, 90)];
[pv setEnableBottomFoldDragging:NO];
[pv setEnableTopFoldDragging:NO];
pv.delegate = self;

UIImageView *leftV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 60, 90)];
leftV.image = [UIImage imageNamed:@"icon_directory_comedy.png"];
leftV.contentMode = UIViewContentModeCenter;
leftV.backgroundColor = [UIColor redColor];


UILabel *rightV = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 60, 90)];
rightV.backgroundColor = [UIColor blueColor];
rightV.text = @"favourite";

[pv setLeftFoldContentView:leftV foldCount:1 pullFactor:0.9];
[pv setRightFoldContentView:rightV foldCount:1 pullFactor:0.9];

[pv setCenterContentView:cell.contentView];

//[cell.contentView removeFromSuperview];

[cell addSubview:pv];

[self configureCell:cell atIndexPath:indexPath];

return cell;
}
@cooler333
Copy link

same problem

@chewedon
Copy link

Hello everyone, I hope this isn't too late but I came across this problem today and I found a fix.

It seems like the UIPanGestureRecognizer is stealing all the touches. We simply need to tell PaperFoldView to return YES in the recognize simulatenous gesture recognizer:

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}

You would of course need to set the delegate of the pan gesture variable to self on line 68 of PaperFoldView class:

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

And don't forget to conform to the UIGestureRecognizerDelegate protocol in the PaperFoldView header file:

@interface PaperFoldView : UIView <MultiFoldViewDelegate, UIGestureRecognizerDelegate>

Hope that helps :D

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

3 participants