Post

Replies

Boosts

Views

Activity

Reply to Compositional Layout's broken `visibleItemsInvalidationHandler`
I debugged a bit deeper by subclassing the UICollectionViewCompositionalLayout. The main difference I saw between a working and a failing version is the callback for func invalidateLayout(with context: UICollectionViewLayoutInvalidationContext), for which the working version's parameter contains actual values for invalidatedItemIndexPaths in its context, meanwhile the failing version does not. Again, same code and same customization. In both, the printed modified NSCollectionLayoutVisibleItem reads the same, only difference between the layout property printed.
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’25
Reply to App crashing randomly - Not possible to remove variable
Hello! I was experiencing a similar crash as everyone else in the thread as well, in which I also have an UIStackView inside a reusable cell. For us we noticed that it could be tracked back to a rogue UIStackView with the distribution set to .fillProportionally. This seems to cause the view to generate layout inconsistencies that every now and then would result in an invalid state that would crash when trying to remove the subviews. Simply using a different distribution (while keeping same layout) was enough to prevent the crash from happening. I have now run about 10000 tests and all were successful.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’24