Remove duplicated keyPath implementations in both collectionview and tableviewdata by abstract them into a protocol.
Implementations
Added KeyPathType protocol into project, abstracted some shared keyPath related function from collectionViewData as well as tableViewData
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.
Added default implementations for those abstracted function by calling helper functions.
Moved struct KeyPath into a shared place, removed one duplicated in either collectionViewData or tableViewData.
Purpose
Remove duplicated
keyPath
implementations in bothcollectionview
andtableviewdata
by abstract them into a protocol.Implementations
KeyPathType
protocol into project, abstracted some shared keyPath related function fromcollectionViewData
as well astableViewData
collectionViewData
andtableViewData
such as getkeyPath
by item or row. Those helper functions will not be implemented in protocol extension but instead in each eithertableViewData
orcollectionViewData
classes.KeyPath
into a shared place, removed one duplicated in eithercollectionViewData
ortableViewData
.