-
Notifications
You must be signed in to change notification settings - Fork 498
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
Error when using a collectionView with a custom UICollectionViewLayout. #241
Comments
@jdisho It would be helpful to see an example of your project 🤔. Maybe It can be an issue in the library, but I have custom layouts implemented in some |
Hey @freak4pc - Thanks for reminding me. |
What environment are you using? I tried but couldn't reproduce the crash with Xcode Version 9.4.1 (9F2000) and iPhone X Simulator with 11.4, on High Sierra. |
Can't repro as well on Mojave Xcode 9.4.1 |
Are you in |
You didn't mention a branch ;-) |
Sorry for the confusion. However, the link is with that branch 😄 |
The link directed to that branch. For some reason I still managed to download the -dev branch version. |
for item in 0..<collectionView.numberOfItems(inSection: 0) { Line 54 in your new layout, |
Yes it is, but I don't expect 0 sections. Probably I am missing something from RxDataSources |
It looked like the whole observable sequence didn't even start yet, so this seems to happen before the items are in the collection view. If you add |
You are right, but how is the normal flow layout is handling this then?! 🤔 |
In your prepare() implementation add a check of numberOfSections guard cache.isEmpty == true,
let collectionView = collectionView,
collectionView.numberOfSections > 0 else { return } 😀 |
Click here for set custom collection view flow layout i objective C Click here for set custom collection cell in collectionview in swift |
@bordoli |
Hi 👋
I have created a custom UICollectionViewLayout.
Then in a
ViewController
I am configuring acollectionView
with thePinterestLayout
and also thedataSource
, as following:The problem that I am occurring when I am running the app is that I get the following error:
I think this issue is related to RxDataSource underlying implementation. However, if you think it is not, it would be very helpful to show an example how to use this library with custom UICollectionViewLayout-s. 😊
The text was updated successfully, but these errors were encountered: