Open jdisho opened 6 years ago
@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 UICollectionViews
and I don't have any issue with the library.
Hey @jdisho - Did you work this out? If not, as @Vkt0r mentioned, a project would be very helpful.
Hey @freak4pc - Thanks for reminding me.
Have a look at Papr @freak4pc
SearchPhoto
is responsible group.
To replicate the crash, go to Search
-> search something
-> Photos with "..."
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 rxdatasources-not-working
branch?
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, PinterestLayout
.
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 .debug()
to the sequence where you do the binding, there's no output before it crashes because of the layout.
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
sorry for mentioning you🙏
why we should check numberOfSections > 0
?
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. 😊