Shopify / FunctionalTableData

Declarative UITableViewDataSource implementation
MIT License
365 stars 30 forks source link

Abstracted code with protocol in tableview and collection view data. #135

Closed alexliubj closed 5 years ago

alexliubj commented 5 years ago

Purpose

Remove duplicated keyPath implementations in both collectionview and tableviewdata by abstract them into a protocol.

Implementations

  1. Added KeyPathType protocol into project, abstracted some shared keyPath related function from collectionViewData as well as tableViewData
  2. Defined some other helper functions that differs in collectionViewData and tableViewData such as get keyPath by item or row. Those helper functions will not be implemented in protocol extension but instead in each either tableViewData or collectionViewData classes.
  3. Added default implementations for those abstracted function by calling helper functions.
  4. Moved struct KeyPath into a shared place, removed one duplicated in either collectionViewData or tableViewData.
ghost commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 3 days if no further activity occurs.