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

Reload Items At Index Paths #19

Closed
kolinkrewinkel opened this issue Aug 3, 2011 · 3 comments
Closed

Reload Items At Index Paths #19

kolinkrewinkel opened this issue Aug 3, 2011 · 3 comments
Labels
Milestone

Comments

@kolinkrewinkel
Copy link
Owner

via -reloadItemsAtIndexPaths: This should be a piece of cake with a for loop or enumeration and calling -setNeedsDisplay.

@jonsterling
Copy link
Collaborator

I'm working on this right now. I haven't been that active thus so far, so I want to be sure that I'm not implementing this incorrectly. What I've got is:

- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths
{
    for (KKIndexPath *path in indexPaths) {
        KKGridViewCell *cell = [_visibleCells objectForKey:path];
        if (cell) {
            [cell removeFromSuperview];
            [_visibleCells removeObjectForKey:path];
        }

        cell = [_dataSource gridView:self cellForRowAtIndexPath:path];
        [_visibleCells setObject:cell forKey:path];
        cell.frame = [self rectForCellAtIndexPath:path];

        [self addSubview:cell];
        [self sendSubviewToBack:cell];
    }
}

Is that vaguely what you were expecting, or am I barking up the wrong tree?

@kolinkrewinkel
Copy link
Owner Author

I think that's a good idea, but we need to fix issue #14 first. Want to move over to that one?

@jonsterling
Copy link
Collaborator

Sure, I'll take a look.

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

No branches or pull requests

2 participants