I have a nested collectionView which I would like to get the readableContentGuide
for after rotation in order to set the content inset correctly.
This is what it looks like:
I have already tried to subclass the collection view and get the value from layoutMarginsDidChange
, traitCollectionDidChange
, and layoutSubviews
.
However the value I get there is always the previous value (i.e when I'm in portrait I get the landscape value and vice versa)
I have also tried to set the inset in the collectionView's collectionView(_:layout:insetForSectionAt:)
.
Currently, the only solution that seems to work is observing the bounds of the collection view, but that feels a bit hacky.
Any thoughts on how this can be done?