From d37197a942a7040166d30ff31c13630df11f276d Mon Sep 17 00:00:00 2001 From: Denys Telezhkin Date: Wed, 2 Sep 2020 13:22:20 +0300 Subject: [PATCH] Releasing version 9.0.0-beta.1. --- CHANGELOG.md | 2 + DTModelStorage.podspec | 2 +- Supporting files/Framework.plist | 2 +- Supporting files/Info.plist | 2 +- docs/Classes.html | 21 +- docs/Classes/BaseSupplementaryStorage.html | 18 +- docs/Classes/BaseUpdateDeliveringStorage.html | 20 +- docs/Classes/CoreDataStorage.html | 18 +- docs/Classes/EventReaction.html | 447 ++++++- docs/Classes/FiveArgumentsEventReaction.html | 163 +-- docs/Classes/FourArgumentsEventReaction.html | 151 +-- docs/Classes/MemoryStorage.html | 70 +- docs/Classes/MemoryStorageAnomalyHandler.html | 18 +- .../ProxyDiffableDataSourceStorage.html | 18 +- docs/Classes/SectionModel.html | 36 +- .../SingleSectionEquatableStorage.html | 18 +- .../Classes/SingleSectionHashableStorage.html | 18 +- docs/Classes/SingleSectionStorage.html | 18 +- docs/Classes/StorageUpdate.html | 18 +- docs/Classes/ViewModelMapping.html | 1071 ++++++++++++++++- docs/Enums.html | 17 +- docs/Enums/ChangeType.html | 18 +- docs/Enums/MappingCondition.html | 18 +- docs/Enums/MemoryStorageAnomaly.html | 18 +- docs/Enums/MemoryStorageError.html | 20 +- .../MemoryStorageError/InsertionReason.html | 20 +- .../MemoryStorageError/SearchReason.html | 18 +- docs/Enums/RuntimeHelper.html | 18 +- docs/Enums/SingleSectionOperation.html | 18 +- docs/Enums/ViewType.html | 38 +- docs/Extensions.html | 71 +- docs/Extensions/UINib.html | 18 +- docs/Global Variables.html | 17 +- docs/Protocols.html | 45 +- docs/Protocols/AccumulationStrategy.html | 18 +- docs/Protocols/AnomalyHandler.html | 18 +- docs/Protocols/EntityIdentifiable.html | 18 +- docs/Protocols/EquatableDiffingAlgorithm.html | 18 +- docs/Protocols/HashableDiffingAlgorithm.html | 18 +- docs/Protocols/ModelTransfer.html | 18 +- docs/Protocols/Section.html | 18 +- docs/Protocols/SectionLocatable.html | 18 +- .../SectionLocationIdentifyable.html | 18 +- docs/Protocols/Storage.html | 18 +- docs/Protocols/StorageUpdating.html | 18 +- docs/Protocols/SupplementaryStorage.html | 18 +- docs/Protocols/ViewModelMappingProtocol.html | 713 +++++++++++ docs/Structs.html | 17 +- .../Structs/AdditiveAccumulationStrategy.html | 18 +- .../DeleteOldValuesAccumulationStrategy.html | 18 +- .../UpdateOldValuesAccumulationStrategy.html | 18 +- docs/badge.svg | 6 +- .../Contents/Resources/Documents/Classes.html | 21 +- .../Classes/BaseSupplementaryStorage.html | 18 +- .../Classes/BaseUpdateDeliveringStorage.html | 20 +- .../Documents/Classes/CoreDataStorage.html | 18 +- .../Documents/Classes/EventReaction.html | 447 ++++++- .../Classes/FiveArgumentsEventReaction.html | 163 +-- .../Classes/FourArgumentsEventReaction.html | 151 +-- .../Documents/Classes/MemoryStorage.html | 70 +- .../Classes/MemoryStorageAnomalyHandler.html | 18 +- .../ProxyDiffableDataSourceStorage.html | 18 +- .../Documents/Classes/SectionModel.html | 36 +- .../SingleSectionEquatableStorage.html | 18 +- .../Classes/SingleSectionHashableStorage.html | 18 +- .../Classes/SingleSectionStorage.html | 18 +- .../Documents/Classes/StorageUpdate.html | 18 +- .../Documents/Classes/ViewModelMapping.html | 1071 ++++++++++++++++- .../Contents/Resources/Documents/Enums.html | 17 +- .../Resources/Documents/Enums/ChangeType.html | 18 +- .../Documents/Enums/MappingCondition.html | 18 +- .../Documents/Enums/MemoryStorageAnomaly.html | 18 +- .../Documents/Enums/MemoryStorageError.html | 20 +- .../MemoryStorageError/InsertionReason.html | 20 +- .../MemoryStorageError/SearchReason.html | 18 +- .../Documents/Enums/RuntimeHelper.html | 18 +- .../Enums/SingleSectionOperation.html | 18 +- .../Resources/Documents/Enums/ViewType.html | 38 +- .../Resources/Documents/Extensions.html | 71 +- .../Resources/Documents/Extensions/UINib.html | 18 +- .../Resources/Documents/Global Variables.html | 17 +- .../Resources/Documents/Protocols.html | 45 +- .../Protocols/AccumulationStrategy.html | 18 +- .../Documents/Protocols/AnomalyHandler.html | 18 +- .../Protocols/EntityIdentifiable.html | 18 +- .../Protocols/EquatableDiffingAlgorithm.html | 18 +- .../Protocols/HashableDiffingAlgorithm.html | 18 +- .../Documents/Protocols/ModelTransfer.html | 18 +- .../Documents/Protocols/Section.html | 18 +- .../Documents/Protocols/SectionLocatable.html | 18 +- .../SectionLocationIdentifyable.html | 18 +- .../Documents/Protocols/Storage.html | 18 +- .../Documents/Protocols/StorageUpdating.html | 18 +- .../Protocols/SupplementaryStorage.html | 18 +- .../Protocols/ViewModelMappingProtocol.html | 713 +++++++++++ .../Contents/Resources/Documents/Structs.html | 17 +- .../Structs/AdditiveAccumulationStrategy.html | 18 +- .../DeleteOldValuesAccumulationStrategy.html | 18 +- .../UpdateOldValuesAccumulationStrategy.html | 18 +- .../Contents/Resources/Documents/badge.svg | 16 +- .../Contents/Resources/Documents/index.html | 273 +---- .../Contents/Resources/Documents/search.json | 2 +- .../Resources/Documents/undocumented.json | 316 ++++- .../Contents/Resources/docSet.dsidx | Bin 90112 -> 98304 bytes docs/docsets/DTModelStorage.tgz | Bin 157007 -> 166419 bytes docs/docsets/DTModelStorage.xml | 2 +- docs/index.html | 273 +---- docs/search.json | 2 +- docs/undocumented.json | 152 ++- fastlane/Fastfile | 9 - 110 files changed, 6060 insertions(+), 1953 deletions(-) create mode 100644 docs/Protocols/ViewModelMappingProtocol.html create mode 100644 docs/docsets/DTModelStorage.docset/Contents/Resources/Documents/Protocols/ViewModelMappingProtocol.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f2cd00d..8111bdb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. # Next +## [9.0.0-beta.1](https://github.com/DenTelezhkin/DTModelStorage/releases/tag/9.0.0-beta.1) + ### Added * `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. diff --git a/DTModelStorage.podspec b/DTModelStorage.podspec index fe8a3b44..53b8caca 100644 --- a/DTModelStorage.podspec +++ b/DTModelStorage.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'DTModelStorage' - s.version = "8.1.0" + s.version = "9.0.0-beta.1" s.license = 'MIT' s.summary = 'Storage classes for datasource based controls.' s.homepage = 'https://github.com/DenTelezhkin/DTModelStorage' diff --git a/Supporting files/Framework.plist b/Supporting files/Framework.plist index e4370ca6..34acc8b3 100644 --- a/Supporting files/Framework.plist +++ b/Supporting files/Framework.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 8.1.0 + 9.0.0-beta.1 CFBundleSignature ???? CFBundleVersion diff --git a/Supporting files/Info.plist b/Supporting files/Info.plist index 457dd1a0..20b141d4 100644 --- a/Supporting files/Info.plist +++ b/Supporting files/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 8.1.0 + 9.0.0-beta.1 CFBundleVersion $(CURRENT_PROJECT_VERSION) diff --git a/docs/Classes.html b/docs/Classes.html index c9f6dbda..cd4f3c9e 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -21,9 +21,9 @@

- DTModelStorage 8.1.0 Docs + DTModelStorage 9.0.0-beta.1 Docs - (89% documented) + (84% documented)

@@ -152,12 +152,6 @@

+
  • +
    + + + + modelTypeTypeCheckingBlock + +
    +
    +
    +
    +
    +
    +

    Closure, that can be used to check model type when model is not available(generic context for example, when model Type is available only).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var modelTypeTypeCheckingBlock: (Any.Type) -> Bool
    + +
    +
    +
    +
    +
  • @@ -443,7 +468,7 @@

    Declaration

    -

    Reuse identifier to be used for reusable views.

    +

    Reuse identifier to be used for reusable views. Mappings for UICollectionViewCell and UICollectionReusableView on iOS 14 / tvOS 14 and higher ignore this parameter.

    @@ -460,9 +485,117 @@

    Declaration

  • +
    +
    +
    +
    +
    +

    If cell is designed in storyboard, and thus don’t require explicit UITableView/UICollectionView registration, please set this property to true. Defaults to false.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var cellRegisteredByStoryboard: Bool
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    If supplementary view is designed in storyboard, and thus don’t require explicit UITableView/UICollectionView registration, please set this property to true. Defaults to false.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var supplementaryRegisteredByStoryboard: Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + reactions + +
    +
    +
    +
    +
    +
    +

    Event reactions, attached to current mapping instance

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var reactions: [EventReaction]
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + modelCondition(_:) + +
    +
    +
    +
    +
    +
    +

    Returns custom MappingCondition that allows to customize mappings based on IndexPath and ModelType.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func modelCondition(_ condition: @escaping (IndexPath, Model) -> Bool) -> MappingCondition
    + +
    +
    +
    +
    +
  • +
  • +
    @@ -470,7 +603,7 @@

    Declaration

    -

    Creates ViewModelMapping for viewClass

    +

    Undocumented

    @@ -487,9 +620,69 @@

    Declaration

  • +
    +
    +
    +
    +
    +

    Creates ViewModelMapping for UICollectionViewCell registration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(cellConfiguration: @escaping ((View, Model, IndexPath) -> Void),
    +                      mapping: ((ViewModelMapping<View, Model>) -> Void)?)
    +    where View: UICollectionViewCell
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + cellConfiguration + + +
    +

    Cell handler closure to be executed when cell is dequeued.

    +
    +
    + + mapping + + +
    +

    mapping closure, that is executed at the end of initializer to allow mapping customization.

    +
    +
    +
    +
    +
    +
  • +
  • +
    @@ -497,17 +690,853 @@

    Declaration

    -

    Creates ViewModelMapping for modelType

    +

    Creates ViewModelMapping for UITableViewCell registration.

    Declaration

    Swift

    -
    public static func eventsModelMapping<T>(viewType: ViewType, modelClass: T.Type) -> ViewModelMapping
    +
    public init(cellConfiguration: @escaping ((View, Model, IndexPath) -> Void),
    +                      mapping: ((ViewModelMapping<View, Model>) -> Void)?)
    +    where View: UITableViewCell
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + cellConfiguration + + +
    +

    Cell handler closure to be executed when cell is dequeued.

    +
    +
    + + mapping + + +
    +

    mapping closure, that is executed at the end of initializer to allow mapping customization.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates ViewModelMapping for UICollectionViewCell registration. This initializer is used, when UICollectionViewCell conforms to ModelTransfer protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(cellConfiguration: @escaping ((View, View.ModelType, IndexPath) -> Void),
    +            mapping: ((ViewModelMapping<View, View.ModelType>) -> Void)?)
    +    where View: UICollectionViewCell, View: ModelTransfer, View.ModelType == Model
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + cellConfiguration + + +
    +

    Cell handler closure to be executed when cell is dequeued.

    +
    +
    + + mapping + + +
    +

    mapping closure, that is executed at the end of initializer to allow mapping customization.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates ViewModelMapping for UITableViewCell registration. This initializer is used, when UICollectionViewCell conforms to ModelTransfer protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(cellConfiguration: @escaping ((View, View.ModelType, IndexPath) -> Void),
    +            mapping: ((ViewModelMapping<View, View.ModelType>) -> Void)?)
    +    where View: UITableViewCell, View: ModelTransfer, View.ModelType == Model
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + cellConfiguration + + +
    +

    Cell handler closure to be executed when cell is dequeued.

    +
    +
    + + mapping + + +
    +

    mapping closure, that is executed at the end of initializer to allow mapping customization.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates ViewModelMapping for UICollectionReusableView registration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(kind: String,
    +            supplementaryConfiguration: @escaping ((View, Model, IndexPath) -> Void),
    +            mapping: ((ViewModelMapping<View, Model>) -> Void)?)
    +    where View: UICollectionReusableView
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + kind + + +
    +

    kind of supplementary view

    +
    +
    + + supplementaryConfiguration + + +
    +

    Supplementary handler closure to be executed when supplementary view is dequeued

    +
    +
    + + mapping + + +
    +

    mapping closure, that is executed at the end of initializer to allow mapping customization.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates ViewModelMapping for UITableView header/footer registration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(kind: String,
    +            headerFooterConfiguration: @escaping ((View, Model, Int) -> Void),
    +            mapping: ((ViewModelMapping<View, Model>) -> Void)?)
    +    where View: UIView
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + kind + + +
    +

    kind of supplementary view. DTTableViewElementSectionHeader for headers and DTTableViewElementSectionFooter for footers.

    +
    +
    + + headerFooterConfiguration + + +
    +

    Header/footer handler closure to be executed when header/footer is dequeued.

    +
    +
    + + mapping + + +
    +

    mapping closure, that is executed at the end of initializer to allow mapping customization.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates ViewModelMapping for UICollectionReusableView registration. This initializer is used, when UICollectionSupplementaryView conforms to ModelTransfer protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(kind: String,
    +            supplementaryConfiguration: @escaping ((View, View.ModelType, IndexPath) -> Void),
    +            mapping: ((ViewModelMapping<View, Model>) -> Void)?)
    +where View: UICollectionReusableView, View: ModelTransfer, Model == View.ModelType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + kind + + +
    +

    kind of supplementary view

    +
    +
    + + supplementaryConfiguration + + +
    +

    Supplementary handler closure to be executed when supplementary view is dequeued

    +
    +
    + + mapping + + +
    +

    mapping closure, that is executed at the end of initializer to allow mapping customization.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates ViewModelMapping for UITableView header/footer registration. This initializer is used when header/footer conforms to ModelTransfer protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(kind: String,
    +            headerFooterConfiguration: @escaping ((View, View.ModelType, Int) -> Void),
    +            mapping: ((ViewModelMapping<View, Model>) -> Void)?)
    +where View: UIView, View: ModelTransfer, Model == View.ModelType
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + kind + + +
    +

    kind of supplementary view. DTTableViewElementSectionHeader for headers and DTTableViewElementSectionFooter for footers.

    +
    +
    + + headerFooterConfiguration + + +
    +

    Header/footer handler closure to be executed when header/footer is dequeued.

    +
    +
    + + mapping + + +
    +

    mapping closure, that is executed at the end of initializer to allow mapping customization.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Update cell at indexPath with model. This can be used in scenarios where you want to update a cell, but animations are not required. +For example, DTCollectionViewManager.coreDataUpdater() uses this technique. For details, read more in https://github.com/DenTelezhkin/DTModelStorage/blob/master/Documentation/CoreData%20storage.md

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func updateCell(cell: Any, at indexPath: IndexPath, with model: Any)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + cell + + +
    +

    visible cell instance

    +
    +
    + + indexPath + + +
    +

    location of the cell

    +
    +
    + + model + + +
    +

    data model to update with

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Dequeues reusable cell for model, indexPath from tableView. Calls cellConfiguration closure, that was passed to initializer, then calls ModelTransfer.update(with:) if this cell conforms to ModelTransfer protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dequeueConfiguredReusableCell(for tableView: UITableView, model: Any, indexPath: IndexPath) -> UITableViewCell?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + tableView + + +
    +

    UITableView instance to dequeue cell from

    +
    +
    + + model + + +
    +

    model object, that was mapped to cell type.

    +
    +
    + + indexPath + + +
    +

    IndexPath, at which cell is going to be displayed.

    +
    +
    +
    +
    +

    Return Value

    +

    dequeued configured UITableViewCell instance.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Dequeues reusable supplementary view for model, indexPath from tableView. Calls headerFooterConfiguration closure, that was passed to initializer, then calls ModelTransfer.update(with:) if this header/footer conforms to ModelTransfer protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dequeueConfiguredReusableSupplementaryView(for tableView: UITableView, kind: String, model: Any, indexPath: IndexPath) -> UIView?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + tableView + + +
    +

    UITableView instance to dequeue header/footer from

    +
    +
    + + kind + + +
    +

    kind of supplementary view. DTTableViewElementSectionHeader for headers and DTTableViewElementSectionFooter for footers.

    +
    +
    + + model + + +
    +

    model object, that was mapped to header/footer type.

    +
    +
    + + indexPath + + +
    +

    IndexPath, at which header/footer is going to be displayed. IndexPath.row of this IndexPath is ignored.

    +
    +
    +
    +
    +

    Return Value

    +

    dequeued configured header/footer.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Dequeues reusable cell for model, indexPath from collectionView. Calls cellConfiguration closure, that was passed to initializer, then calls ModelTransfer.update(with:) if this cell conforms to ModelTransfer protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dequeueConfiguredReusableCell(for collectionView: UICollectionView, model: Any, indexPath: IndexPath) -> UICollectionViewCell?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + collectionView + + +
    +

    UICollectionView instance to dequeue cell from

    +
    +
    + + model + + +
    +

    model object, that was mapped to cell type.

    +
    +
    + + indexPath + + +
    +

    IndexPath, at which cell is going to be displayed.

    +
    +
    +
    +
    +

    Return Value

    +

    dequeued configured UICollectionViewCell instance.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Dequeues reusable supplementary view for model, indexPath from tableView. Calls supplementaryConfiguration closure, that was passed to initializer, then calls ModelTransfer.update(with:) if this header/footer conforms to ModelTransfer protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dequeueConfiguredReusableSupplementaryView(for collectionView: UICollectionView, kind: String, model: Any, indexPath: IndexPath) -> UICollectionReusableView?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + collectionView + + +
    +

    UICollectionView instance to dequeue supplementary view from

    +
    +
    + + kind + + +
    +

    kind of supplementary view.

    +
    +
    + + model + + +
    +

    model object, that was mapped to supplementary view type.

    +
    +
    + + indexPath + + +
    +

    IndexPath, at which supplementary view is going to be displayed.

    +
    +
    +
    +
    +

    Return Value

    +

    dequeued configured supplementary view.

    +
  • @@ -519,8 +1548,8 @@

    Declaration

    diff --git a/docs/Enums.html b/docs/Enums.html index 942f5f8a..4e0b8f11 100644 --- a/docs/Enums.html +++ b/docs/Enums.html @@ -21,9 +21,9 @@

    - DTModelStorage 8.1.0 Docs + DTModelStorage 9.0.0-beta.1 Docs - (89% documented) + (84% documented)

    @@ -152,12 +152,6 @@

  • diff --git a/docs/Enums/ChangeType.html b/docs/Enums/ChangeType.html index fb788a16..8970c0f6 100644 --- a/docs/Enums/ChangeType.html +++ b/docs/Enums/ChangeType.html @@ -21,9 +21,9 @@

    - DTModelStorage 8.1.0 Docs + DTModelStorage 9.0.0-beta.1 Docs - (89% documented) + (84% documented)

    @@ -152,12 +152,6 @@