-
Notifications
You must be signed in to change notification settings - Fork 14
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
NSInternalInconsistencyException on Collection View Updating #5
NSInternalInconsistencyException on Collection View Updating #5
Conversation
…r removing items from a collection view
Thanks @AnthonyMDev! Now I'm very puzzled why this fixed it :) |
Does the issue occur only when moving/reordering items? I'm having trouble reproducing this. |
This is caused by a bug in UICollectionView. There isn't a really great explanation of the cause out there. This is the best information I can show you. |
Playing further with this... It seams that in the implementation of I'm thinking of adding a way to do silent updates of the observable collection, like: array.silentUpdate { proxy in
proxy.moveItemAtIndex(0, toIndex: 3)
} |
@@ -72,19 +72,21 @@ public class RKCollectionViewDataSource<C: ObservableCollectionType where C.Coll | |||
|
|||
collectionView.dataSource = self | |||
collectionView.reloadData() | |||
|
|||
observableCollection.skip(1).observe(on: ImmediateOnMainExecutionContext) { [weak self] event in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just change ImmediateOnMainExecutionContext
to MainExecutionContext
and it will do dispatch_async(dispatch_get_main_queue()...
:)
@srdanrasic I've updated the PR to use 'MainExecutionContext'. |
Added this manually so I'll close this. Available in v1.0.10. Can you check if it still crashes? I guess you should now do the |
@srdanrasic This is causing me issues again. When we had updated to use |
Never mind, I had another issue that was causing this. This code looks good. Thanks @srdanrasic ! |
This fixes #3 and DeclarativeHub/ReactiveKit#11.
The
.gitmodule
file needed to be removed in order for me to clone the repository, as I don't have access to the submodules. @srdanrasic, I don't know of a better way to handle that...