What does indexpath
mean for UICollectionView's supplementaryView or decorationView?
layoutAttributesForSupplementaryViewOfKind:atIndexPath:
layoutAttributesForDecorationViewOfKind:atIndexPath:
This Documentation says :
It is up to you to decide how to use the indexPath parameter to identify a given supplementary view. Typically, you use the elementKind parameter to identify the type of the supplementary view and the indexPath information to distinguish between different instances of that view.
Same for decoration views.
In other words there is absolutely no correlation between a cell indexPath which corresponds to a position in the data source, and the indexPath of the supplementary or decoration view which corresponds to whatever you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With