I have a custom UICollectionViewLayout
that makes use of the self-sizing mechanism in iOS 8. My UICollectionViewCell
's implement preferredLayoutAttributesFittingAttributes
to return their preferred size, calculated using auto-layout. This works fine.
However, I was expecting preferredLayoutAttributesFittingAttributes
to also work for supplementary views, but it is never called. It is defined on UICollectionReusableView
after all.
If this mechanism is only for cells, what is the correct way to use auto-layout to size supplementary views in a custom UICollectionViewLayout
?