Post

Replies

Boosts

Views

Activity

Reply to UICollectionViewRecursion when using estimated sizes in Compositional Layout
This is getting quite specific to our particular implementation, but I believe we've found a workaround for our crash and thought I'd share in case it is of some use. Our workaround is using floor on some of our computed values (e.g. the width of some layout attributes). My pet theory is that the bug is related to some floating point precision issue, or possibly some rounding occurring elsewhere. This doesn't actually remove the warnings, but were able to reproduce the crash on one of our test devices and use that to confirm the workaround works. We're going to ship it and see if we stop getting crash reports in the wild. I was also able to force the crash to happen by using floor in one place but not another. E.g. in our case, the collectionView proposes layout attributes, the cell accepts the width and computes the height it requires - if I return a different width than the one proposed then I can force the crash to happen on any simulator/device running iOS 15. FWIW just before the crash, I got: Enabling recursion trigger logging (rather than the usual Disabling). Hope this information helps others resolve their specific issues.
Nov ’21