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

Binding to UICollectionView not initially configuring collection view #3

Open
AnthonyMDev opened this issue Dec 21, 2015 · 6 comments

Comments

@AnthonyMDev
Copy link

When I bind an ObservableCollection to a UICollectionView, the collection view is not being set up until I make some changes to my collection. The initial values of my collection are not being loaded to the collection view.

I've noticed in debugging that the RKCollectionViewDataSource.sourceCollection is empty, even though the observableCollection has items in it.

This is fixed by removing the skip(1) from observableCollection.skip(1).observe(on: ImmediateOnMainExecutionContext) { [weak self] event in on line 76 of UICollectionView.swift.

Why are we skipping the 1st observation anyways?

@AnthonyMDev
Copy link
Author

I just noticed that, though the sourceCollection is printing to the debugger as {}, sourceCollection.count equals 1. So I'm not sure what is going wrong here.

@srdanrasic
Copy link
Contributor

That does not sound good. I'll check it out :) Thanks for reporting!

@AnthonyMDev
Copy link
Author

AnthonyMDev commented Dec 22, 2015 via email

@AnthonyMDev
Copy link
Author

@srdanrasic After more testing, I've found multiple different issues with this through my unit testing. I'm getting exceptions thrown when trying to insert new items into my ObservableCollection and when I try to move them around in my proxy data source's "didMove" implementation.

All of these issues disappear as soon as I remove skip(1).

@srdanrasic
Copy link
Contributor

srdanrasic commented Sep 23, 2016

@AnthonyMDev those messages smell on some email malware 😟

@AnthonyMDev
Copy link
Author

Yeah not sure what's that's about. Looking into it. :/

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

Successfully merging a pull request may close this issue.

2 participants