-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unify Table* and Collection* components #46
Labels
Milestone
Comments
This will be a pretty large change and we need to refine / flesh out existing APIs first. |
jessesquires
added a commit
that referenced
this issue
Jan 27, 2018
Rather than copy-pasta table view code for collection view, let's unify them. This introduces `CellParentViewProtocol` to reduce duplication in auto-registering cells. It unifies the APIs of tables and collections. On top of this, we add `ReusableCellProtocol` and `ReusableSupplementaryViewProtocol` to unify our cell view models and supplementary view models. Now there's a single API for registering cells automatically. All work based on: https://github.com/jessesquires/JSQDataSourcesKit/blob/develop/Source/ReusableViewConfig.swift Almost completes #18, starts initial work on #46
jessesquires
added a commit
that referenced
this issue
Jan 28, 2018
Rather than copy-pasta table view code for collection view, let's unify them. This introduces `CellParentViewProtocol` to reduce duplication in auto-registering cells. It unifies the APIs of tables and collections. On top of this, we add `ReusableCellProtocol` and `ReusableSupplementaryViewProtocol` to unify our cell view models and supplementary view models. Now there's a single API for registering cells automatically. All work based on: https://github.com/jessesquires/JSQDataSourcesKit/blob/develop/Source/ReusableViewConfig.swift Almost completes #18, starts initial work on #46
jessesquires
added a commit
that referenced
this issue
Jan 28, 2018
* Auto cell registration + unify table and collection views Rather than copy-pasta table view code for collection view, let's unify them. This introduces `CellContainerViewProtocol` to reduce duplication in auto-registering cells. It unifies the APIs of tables and collections. On top of this, we add `ReusableCellProtocol` and `ReusableSupplementaryViewProtocol` to unify our cell view models and supplementary view models. Now there's a single API for registering cells automatically. All work based on: https://github.com/jessesquires/JSQDataSourcesKit/blob/develop/Source/ReusableViewConfig.swift Almost completes #18, starts initial work on #46
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We should be able to unify our table- and collection-specific components into single, generic components using a similar approach to https://github.com/jessesquires/JSQDataSourcesKit.
The model in
JSQDataSourcesKit
and here are a bit different, but we should be able to do this. The main difference is thatJSQDataSourcesKit
does not consume thedelegate
properties — only thedataSource
.Todo (roughly):
CollectionViewCellViewModel
andTableViewCellViewModel
-->CellViewModel<T>
CollectionViewModel
andTableViewModel
-->CellParentViewModel<T>
SectionModel
sCollectionViewDataSource
andTableViewDataSource
-->DataSource<T>
Then, we can implement the
UITableViewDataSource
andUICollectionViewDataSource
methods in constrained extensions onDataSource<T>
similar to this:https://github.com/jessesquires/JSQDataSourcesKit/blob/develop/Source/DataSourceProvider.swift#L64
The text was updated successfully, but these errors were encountered: