Skip to content

Unify Table* and Collection* components #46

Description

@jessesquires

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions