Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dear, please help me: I probably found a big bug, in iOS 10.3 and iOS 11, update datasource will not work correctly, please look at below. #13

Open
willokyes opened this issue Dec 17, 2019 · 2 comments

Comments

@willokyes
Copy link

willokyes commented Dec 17, 2019

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.

70385899-e38e5480-19cc-11ea-9e25-0b016531e582

@ra1028
Copy link
Owner

ra1028 commented Mar 31, 2020

@willokyes

Sorry for my very late reply.

This could be due to a custom layout.
Open a similar issue at IBP and seek advice.

@renssies
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants