I would like to have different backgrounds for different sections in a collection view using compositional layout.
Currently I am using NSCollectionLayoutDecorationItem.background to set the background on a section. However this type of view is not dequeued or recycled the same way that a supplementary view or a cell would be. I can't make changes to it after it's initialized and I don't get to initialize it myself.
I would like to use a colour or background image that is part of the user's data that I retrieve from my back end, so the colour or image is not known to me at compile time.
Is there any way to dynamically set the background image or colour of a section?