Reload only Footer of Section of CollectionView in Swift

I am trying to reload only footer of collectionView of specific section for chat Application to show updated time. But unfortunately I ended up reloading whole Section using below code:

Code Block Swift
let sections = self.collectionView.numberOfSections
let indexSet = IndexSet(integer: sections-1)
self.collectionView.reloadSections(indexSet)


But above code can take long time to load particular section if we have long chat. Please help me out.
Answered by Claude31 in 663876022
You could probably use:
Code Block
func invalidateSupplementaryElements(ofKind elementKind: String, at indexPaths: [IndexPath])

kind being
Code Block
kind = UICollectionElementKindSectionFooter

See other options here:
https://stackoverflow.com/questions/26998761/uicollectionview-is-there-a-way-to-reload-only-the-supplementary-views
Accepted Answer
You could probably use:
Code Block
func invalidateSupplementaryElements(ofKind elementKind: String, at indexPaths: [IndexPath])

kind being
Code Block
kind = UICollectionElementKindSectionFooter

See other options here:
https://stackoverflow.com/questions/26998761/uicollectionview-is-there-a-way-to-reload-only-the-supplementary-views
Thanks a lot. It worked.
Reload only Footer of Section of CollectionView in Swift
 
 
Q