First things first:
- I do NOT Want to reload whole CollectionView.
- I also do NOT want to reload the section either (since it is same as reloadData because my cv only has 1 section).
I put some controls in the Supplementary View since this view acts as a header view. On some case, I want to hide/show the controls as needed. In order to do that I need to reload the Supplementary View as the data for it is already updated.
What I have tried:
UICollectionViewLayoutInvalidationContext *layoutContext =
[[UICollectionViewLayoutInvalidationContext alloc] init];
[layoutContext invalidateSupplementaryElementsOfKind:UICollectionElementKindSectionHeader
atIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]]];
[[_collectionView collectionViewLayout] invalidateLayoutWithContext:layoutContext];
This crash of course. The code doesn't look right either but I am not sure how to construct the UICollectionViewLayoutInvalidationContext properly and telling the collectionview to reload just the Supplementary View.
Thanks.