Open willokyes opened 4 years ago
@willokyes
Sorry for my very late reply.
This could be due to a custom layout. Open a similar issue at IBP and seek advice.
For anyone checking this issue: I've ran into this as well.
As it turns out UICollectionViewFlowLayout and UICollectionViewCompositionalLayout have issues with the layout attributes of decoration views when func performBatchUpdates
is used. DiffableDataSources
always uses func performBatchUpdates
even when not animating.
Developers at Apple found this as well and in a later beta of iOS 13 UICollectionViewDiffableDataSource uses func reloadData
when not animating the changes, this fixed the crash at least when not animating. The bug was completely patched in iOS 14.
My solution was to create a wrapper around UICollectionViewDiffableDataSource that uses UICollectionViewDiffableDataSource on iOS 13+ and the old UICollectionViewDataSource on iOS 12- and it doesn't animate the changes when it knows the decoration views will change.
Dear,
I use IBPCollectionViewCompositionalLayout in iOS 13 will no problem, but in iOS 10 and iOS 11 is not ok, please see the screenshot and the IBPCollectionViewCompositionalLayout.zip example that I sent to you below, run and select OrthogonalScrollBehaviorViewController.swift with iOS 10.3, the Xcode will crash.
Why it is, please help me, I take two days to debug this question, but no answer.
I put the demo.zip project on the Aliyun OSS, sincerely hope you can download the demo project and debug it.
Please download the demo: https://dxy-demo.oss-ap-northeast-1.aliyuncs.com/IBPCollectionViewCompositionalLayout.zip
Or the link of github: https://github.com/willokyes/IBPCollectionViewCompositionalLayout-Demo
I'm looking forward to your reply.
Thank you.