Closed dmonagle closed 4 years ago
Thank you for the demo project David - I was easily able to reproduce the issue using it π
This was due to certain situations resulting in an infinite cycle of calls to layoutSubviews. I have fixed the bug and will push a new version as soon as I have tested further π
The dev branch now contains this fix, you can point there for the time being π
I've made quite a few changes so will test a little further before pushing the new version to master, however both the main demo app and your example app are functioning perfectly π₯³
Fixed in 1.7.0 π
When a change with animation causes views to be added or removed from the collection in rapid succession, it causes a 100% CPU cycle and recursive attempts at a layout until the app crashes out of memory.
This only seems to happen if the next add/removal happens while the animation is still occurring.
To Reproduce
I've written a one page example app which causes this issue pretty easily.
https://github.com/dmonagle/TestASCollectionView
Note that the non animated controls can be used without a problem. The animated button can be used as long as you wait between button presses for the animation to finish. The use of the animated slider will freeze the app almost instantly.
Expected behaviour The cells should animate smoothly in and out no matter how fast the updates. This works fine a manually created CollectionView wrapped as a UIViewControllerRepresentable
Screenshots Instruments stack trace when issue occurs.
Xcode Version: 11.5
Simulator, Device, Both? Simulators and Devices on iOS 13.5