-
Notifications
You must be signed in to change notification settings - Fork 44
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
implement "modelSelected" and more methods "combine way" for UICollectionView and UITableview #11
Comments
I think this might be useful - currently the api allows you to implement this via table delegates but having something along the lines of what RxDataSources has would be fine. I always had an issue with the fact that @nathan-hh do you have a list in mind of which methods besides |
@nathan-hh there seems to be some bug in it with the latest version of Xcode / Swift. @jdisho is working on it AFAIK. |
I would love this! This is how I currently deal with selection using the delegate proxy stuff from CombineCocoa. viewModel.models
.bind(subscriber: collectionView.itemsSubscriber(cellIdentifier: Cell.reuseIdentifier, cellType: Cell.self) { cell, _, model in
cell.configure(model: model)
})
.store(in: &subscriptions)
collectionView.didSelectItemPublisher
.combineLatest(viewModel.models)
.map { indexPath, models in
models[indexPath.item]
}
.sink { model in
// Do whatever you want with the model
}
.store(in: &subscriptions) Not having to do the translation from the IndexPath to a model would be pretty nice :) |
Right, to be honest I'm not 100% sure you could deal with it in the context of this repo without copy-pasting all of the DelegateProxy stuff or have CombineExt as a dependency |
Maybe some conditional imports and functions for if the user happens to have both modules installed? |
Sounds more reasonable to have a RxDataSourcesCore and RxDataSources (or the other way - RxDataSourcesModel vs. RxDataSources) , different dependencies |
No description provided.
The text was updated successfully, but these errors were encountered: