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

Unify Table* and Collection* components #46

Open
jessesquires opened this issue Jan 24, 2018 · 1 comment
Open

Unify Table* and Collection* components #46

jessesquires opened this issue Jan 24, 2018 · 1 comment
Milestone

Comments

@jessesquires
Copy link
Collaborator

jessesquires commented Jan 24, 2018

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 that JSQDataSourcesKit does not consume the delegate properties — only the dataSource.

Todo (roughly):

  • Unify CollectionViewCellViewModel and TableViewCellViewModel --> CellViewModel<T>
  • Unify CollectionViewModel and TableViewModel --> CellParentViewModel<T>
  • Unify the nested SectionModels
  • Unify CollectionViewDataSource and TableViewDataSource --> DataSource<T>

Then, we can implement the UITableViewDataSource and UICollectionViewDataSource methods in constrained extensions on DataSource<T> similar to this:
https://github.com/jessesquires/JSQDataSourcesKit/blob/develop/Source/DataSourceProvider.swift#L64

@jessesquires jessesquires added this to the Next Release milestone Jan 24, 2018
@jessesquires jessesquires self-assigned this Jan 24, 2018
@jessesquires
Copy link
Collaborator Author

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
@jessesquires jessesquires modified the milestone: 0.2.0 Feb 7, 2018
@benasher44 benasher44 modified the milestones: 0.2.0, 0.3.0 Sep 11, 2018
@benasher44 benasher44 modified the milestones: 0.3.0, 0.4.0 Sep 20, 2018
@jessesquires jessesquires modified the milestones: 0.4.0, Next Jan 7, 2019
@jessesquires jessesquires removed their assignment Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants