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

not swippable #6

Open
romaopedro opened this issue Apr 24, 2015 · 1 comment
Open

not swippable #6

romaopedro opened this issue Apr 24, 2015 · 1 comment

Comments

@romaopedro
Copy link

I follow the procedure but I could't make my cell swippable. My CustomCell is a subclass of CADRACSwippableCell and I add the code when draw the cell.

DeckCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];

    UIView *bottomView = [[UIView alloc] init];
    bottomView.frame = (CGRect){
        .size = CGSizeMake(CGRectGetWidth(collectionView.bounds)/2, CGRectGetHeight(cell.bounds))
    };

    cell.allowedDirection = CADRACSwippableCellAllowedDirectionLeft;
    cell.revealView = bottomView;
    [[cell.revealViewSignal filter:^BOOL(NSNumber *isRevealed) {
        return [isRevealed boolValue];
    }] subscribeNext:^(id x) {
        [[self.collectionView visibleCells] enumerateObjectsUsingBlock:^(DeckCollectionViewCell *otherCell, NSUInteger idx, BOOL *stop) {
            if (otherCell != cell)
            {
                [otherCell hideRevealViewAnimated:YES];
            }
        }];
    }];

    bottomView.backgroundColor = [UIColor redColor];

    CDDecks *deck = [_dataSourceArr objectAtIndex:indexPath.row];
    NSArray *cardInDeck = [CDDeckCard MR_findByAttribute:@"idDeck" withValue:deck.idDeck];

    NSInteger numCards = 0;
    for (CDDeckCard *v in cardInDeck) {
        numCards += [v.numReps integerValue];
    }

    [cell cellWithName:deck.name numberCards:@(numCards).stringValue idClass:deck.classType];

    return cell;
@joanromano
Copy link
Owner

@romaopedro sorry, been out for a while. Are you still having the issue?

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

2 participants