Sticky Header animation issue
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];
}
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.
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.