Bot releases are hidden (Show)
displaySectionNameForSupplementaryKinds
, SectionModel.supplementaries
, RealmSection.supplementaries
Published by DenTelezhkin over 1 year ago
Published by DenTelezhkin about 2 years ago
Published by DenTelezhkin over 2 years ago
CellViewModelMapping
, SupplementaryViewModelMapping
base classes and several protocols to cover existing implementation of ViewModelMapping
. Concrete implementation for those base class is now a part of DTTableViewManager
/ DTCollectionViewManager
.ViewModelMapping
and ViewModelMappingProtocol
. Their functionality has been moved into CellViewModelMapping
, SupplementaryViewModelMapping
and protocol extensions on those. Please note, that while technically those are breaking changes, usage of mappings in DTTableViewManager
/ DTCollectionViewManager
is unchanged, and should not introduce breaking changes, unless those type names have been explicitly written in code.Published by DenTelezhkin almost 3 years ago
Section.isEmpty
property indicating that section does not contain any elements. Accessing this property is faster than accessing Section.numberOfItems
property.Published by DenTelezhkin over 3 years ago
defersDatasourceUpdates
on MemoryStorage
. This property was deprecated in previous release and is now removed. MemoryStorage
now always defers updates as if this property was turned on (which was the default).ProxyDiffableDataSourceStorage
. Diffable datasource integration has been restructured in a way, that no longer requires this class.Published by DenTelezhkin over 3 years ago
SectionModel
with array of items.Published by DenTelezhkin over 3 years ago
Published by DenTelezhkin over 3 years ago
UICollectionView.CellRegistration
and UICollectionView.SupplementaryRegistration
once per mapping. This is required for proper cell and supplementary reuse.Published by DenTelezhkin almost 4 years ago
Published by DenTelezhkin almost 4 years ago
Realm CocoaPods subspec has been disabled due to https://github.com/realm/realm-cocoa/issues/6800
Published by DenTelezhkin about 4 years ago
ViewModelMapping.modelCondition
method, that allows to create custom mapping condition, but infers model type from mapping. Behavior of this method is identical to ModelTransfer.modelCondition
method, except that new method does not require cell or view to implement ModelTransfer
protocol.MemoryStorage.insertItems(_:at:)
method, that allows inserting collection starting from provided indexPath. This is useful, for example, if you are using pagination, and want to insert new page of items between old pages and loading indicator.This release requires Swift 5.3.
Some context: this release heavily relies on where clauses on contextually generic declarations, that are only available in Swift 5.3 - SE-0267.
ViewModelMapping
has been reworked to generic class to capture both View and Model type.ViewModelMappingProtocol
protocol has been introduced to represent type-erased interface for ViewModelMapping
so that ViewModelMappingProtocol
instances can be stored in array, and be called without generic information.EventReaction
class has been reworked to not contain ViewModelMapping
instance. ViewModelMapping
class will now instead have an array of EventReaction
instances attached to it. This way it's now possible to restrict events to only happen if current ViewModelMapping
is compatible for requested model/view/location/mapping condition.ViewModelMapping
convenience methods eventsModelMapping
and eventsViewMapping
have been removed.mappingCandidates
method now returns ViewModelMappingProtocol
instead of ViewModelMapping
performReaction
methods now accept IndexPath
for location
parameter instead of Any
.[ViewModelMapping]
to static methods on EventReaction
due to Swift inability to call methods on sequences that contain protocols.mappingCandidates
method has been moved to ViewType
type.EventReaction
has new initializers with more specific names.insertItems(_:to:)
method is no longer throwing. Anomaly is still produced, if count of models differs from count of indexPaths.MemoryStorage.defersDatasourceUpdates
property. Deferring datasource updates and executing them inside of performBatchUpdates block turned out to be the only stable and correct way to apply updates to both UI and datasource. It's highly recommended to leave this property on. It is now deprecated, and may be removed in the future release, maintaining current default behaviour.SectionModel.setItems(_:)
method. Set items directly through items
property.Published by DenTelezhkin over 4 years ago
Please note, that this framework version source is identical to previous version (apart from some small Realm adjustments), which supports iOS 8 / tvOS 9 / Swift 4.0 and higher.
Published by DenTelezhkin almost 5 years ago
Published by DenTelezhkin about 5 years ago
Published by DenTelezhkin about 5 years ago
This is a major release with some breaking changes, please read DTModelStorage 8.0 Migration Guide
bundle
property on ViewModelMapping
, that exposes recommended bundle to be used when searching for resources of given mapping.SingleSectionStorage.items
property.Section.item(at:)
method.ProxyDiffableDataSourceStorage
that serves as a bridge between DTTableViewManager
/DTCollectionViewManager
and diffable datasource classes(UITableViewDiffableDataSource
`UICollectionViewDiffableDataSource`).configureForTableViewUsage
, configureForCollectionViewUsage
, headerModel(forSection:)
, footerModel(forSection:)
, have been moved to protocol extensions instead of being implemented in BaseStorage
class. As a consequence, BaseStorage
no longer confirms to HeaderFooterStorage protocol.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 to SectionLocatable
HeaderFooterStorage
and HeaderFooterSettable
have been removedHeaderFooterStorage
functionality mostly has been merged into new protocol SupplementaryStorage
BaseStorage
has been split into BaseSupplementaryStorage
and BaseUpdateDeliveringStorage
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.
MemoryStorageError.BatchInsertionReason
enum.ViewModelMappingCustomizing
protocol.sections
method on Storage
protocol. It is replaced by more perfomant numberOfSections()
and numberOfItems(inSection:)
methods.sections
method on CoreDataStorage
and SingleSectionStorage
items
property on Section
protocol. It is replaced by item(at:)
method.Published by DenTelezhkin over 5 years ago
bundle
property on ViewModelMapping
, that exposes recommended bundle to be used when searching for resources of given mapping.setItemsForAllSections
method now properly removes all sections prior to setting new ones. This prevents a bug, where old sections could stay, if this method was called with fewer number of sections.Published by DenTelezhkin over 5 years ago
item(at:)
method perfomance.ViewModelMapping.xibName
can now be changed inside of mapping blocks to allow changing xibName per mapping.Published by DenTelezhkin over 5 years ago
ViewModelMappingCustomizing
protocol. Please switch to using mapping conditions instead.Published by DenTelezhkin over 5 years ago
enqueueDatasourceUpdate
method and enqueuedDatasourceUpdates
property public to allow building custom storages that defer datasource updates.