uicollectionview-gridlayout icon indicating copy to clipboard operation
uicollectionview-gridlayout copied to clipboard

Sticky Header animation issue

Open futuretap opened this issue 12 years ago • 2 comments

I've an issue when using the sticky header feature in combination with cell deletion. The section header doesn't stick. See this screen video:

http://d.pr/v/gS8U

To reproduce the issue, just add this method to StickyHeadersCollectionViewController.m:

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    [collectionView performBatchUpdates:^{
        TLIndexPathSectionInfo *section = [self.indexPathController.dataModel sectionInfoForSection:indexPath.section];
        NSMutableArray *filtered = [section.objects mutableCopy];
        [filtered removeObjectAtIndex:indexPath.row];
        section = [[TLIndexPathSectionInfo alloc] initWithItems:filtered name:section.name];

        NSMutableArray *sectionInfos = [self.indexPathController.dataModel.sections mutableCopy];
        sectionInfos[indexPath.section] = section;
        self.indexPathController.dataModel = [[TLIndexPathDataModel alloc] initWithSectionInfos:sectionInfos identifierKeyPath:nil];
    } completion:nil];
}

futuretap avatar Dec 29 '13 17:12 futuretap

I'll take a look after the holidays.

Best,

Tim

On Dec 29, 2013, at 11:33 AM, FutureTap [email protected] wrote:

I've an issue when using the sticky header feature in combination with cell deletion. The section header doesn't stick. See this screen video:

http://d.pr/v/gS8U

To reproduce the issue, just add this method to StickyHeadersCollectionViewController.m:

  • (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { [collectionView performBatchUpdates:^{ TLIndexPathSectionInfo *section = [self.indexPathController.dataModel sectionInfoForSection:indexPath.section]; NSMutableArray *filtered = [section.objects mutableCopy]; [filtered removeObjectAtIndex:indexPath.row]; section = [[TLIndexPathSectionInfo alloc] initWithItems:filtered name:section.name];

    NSMutableArray *sectionInfos = [self.indexPathController.dataModel.sections mutableCopy];
    sectionInfos[indexPath.section] = section;
    self.indexPathController.dataModel = [[TLIndexPathDataModel alloc] initWithSectionInfos:sectionInfos identifierKeyPath:nil];
    

    } completion:nil]; } — Reply to this email directly or view it on GitHub.

wtmoose avatar Dec 29 '13 19:12 wtmoose

I took an initial look at this and made some progress, but if you look at the video closely, you're also encountering issue #3 (Cell pop-in). You've got both cells and headers popping in. The fix I was working on solves half of the problem, but I haven't solved the pop-in problem yet. This month is extremely busy, so I might not get back to it for a while, unfortunately.

wtmoose avatar Jan 14 '14 16:01 wtmoose