8.0.0-beta.1
This is a major release with some breaking changes, please read DTModelStorage 8.0 Migration Guide
Added
bundle
property onViewModelMapping
, that exposes recommended bundle to be used when searching for resources of given mapping.- Setter for
SingleSectionStorage.items
property. Section.item(at:)
method.ProxyDiffableDataSourceStorage
that serves as a bridge betweenDTTableViewManager
/DTCollectionViewManager
and diffable datasource classes(UITableViewDiffableDataSource
`UICollectionViewDiffableDataSource`).
Changed
configureForTableViewUsage
,configureForCollectionViewUsage
,headerModel(forSection:)
,footerModel(forSection:)
, have been moved to protocol extensions instead of being implemented inBaseStorage
class. As a consequence,BaseStorage
no longer confirms to HeaderFooterStorage protocol.
Breaking
Identifiable
protocol has been renamed to EntityIdentifiable
protocol to avoid unwanted clashes with Foundation.Identifiable
protocol, that is available on iOS 13 and higher.
Complete rewrite of header/footer/supplementary model handling. Instead of several implementations and model storages, the API now consists of three closure based properties on SupplementaryStorage
protocol : headerModelProvider
, footerModelProvider
and supplementaryModelProvider
. All storage classes implement this protocol (MemoryStorage
, CoreDataStorage
, RealmStorage
, SingleSectionStorage
, ProxyDiffableDataSourceStorage
).
Storage protocols and classes have been restructured:
SupplementaryAccessible
renamed toSectionLocatable
HeaderFooterStorage
andHeaderFooterSettable
have been removedHeaderFooterStorage
functionality mostly has been merged into new protocolSupplementaryStorage
BaseStorage
has been split intoBaseSupplementaryStorage
andBaseUpdateDeliveringStorage
that inherits from it.
Several methods continue to work, but are now bridging to new closure-based API:
setSectionHeaderModels
setSectionFooterModels
headerModel(forSection:)
footerModel(forSection:)
supplementaryModel(ofKind:forSectionAt:)
setSectionHeaderModels
and setSectionFooterModels
, as well as new closure-based API do not call reloadData method, as they were doing before. If you need to reset section headers/footers/supplementaries, consider calling StorageUpdating.storageNeedsReloading()
method manually.
All methods that allowed to set header/footer/supplementary models partially, for a specific section or specific supplementary kind, have been made unavailable or removed.
CoreDataStorage
now sets headerModelProvider
closure to allow using FetchedResultsController section name as header instead of having arbitrary logic that compared supplementaryKind to displaySectionNameForSupplementaryKinds
property, which is also made unavailable.
Removed
- Deprecated
MemoryStorageError.BatchInsertionReason
enum. - Deprecated
ViewModelMappingCustomizing
protocol. sections
method onStorage
protocol. It is replaced by more perfomantnumberOfSections()
andnumberOfItems(inSection:)
methods.sections
method onCoreDataStorage
andSingleSectionStorage
items
property onSection
protocol. It is replaced byitem(at:)
method.