Changelog History
Page 1
-
v8.0.0
October 27, 2020 -
v8.0.0-beta.1 Changes
September 02, 2020β Added
- Cell and supplementary view events are now available inside mapping closure directly, for example:
// Previous releases manager.register(PostCell.self) manager.didSelect(PostCell.self) { cell, model, indexPath in // React to selection } // New manager.register(PostCell.self) { mapping in mapping.didSelect { cell, model, indexPath in } }
Those events are now tied to
ViewModelMapping
instance, which means, that events, registered this way, will only trigger, if mapping condition of current mapping applies. For example:manager.register(PostCell.self) { mapping in mapping.condition = .section(0) mapping.didSelect { cell, model, indexPath in // This closure will only get called, when user selects cell in the first section } } manager.register(PostCell.self) { mapping in mapping.condition = .section(1) mapping.didSelect { cell, model, indexPath in // This closure will only get called, when user selects cell in the second section } }
π Please note, that headers and footers only support mapping-style event registration, if they inherit from
UITableViewHeaderFooterView
.TableViewConfiguration
semanticHeaderHeight
andsemanticFooterHeight
, that specify whetherDTTableViewManager
should deploy custom logic intableView(_ tableView: UITableView, heightForHeaderInSection section: Int)
andtableView(_ tableView: UITableView, heightForFooterInSection section: Int)
. This logic includes checking whether header and footer models exist in storage, returningUITableView.automaticDimension
for sections, whose header and footer models are Strings (for table section titles), as well as returning minimal height for cases where data model is not there(which happens to be different forUITableView.Style.plain
andUITableView.Style.grouped
). Those properties default to true, but if you want to use self-sizing table view sections headers or footers, which may improve perfomance, consider turning those off:
manager.configuration.semanticHeaderHeight = false manager.configuration.semanticFooterHeight = false
Please note, that even when those properties are set to false, corresponding
UITableViewDelegate
methods will still be called in two cases:- Your
DTTableViewManageable
instance implements them - You register a
heightForHeader(withItem:_:)
orheightForFooter(withItem:_:)
closures onDTTableViewManager
instance.
π₯ Breaking
π This release requires Swift 5.3. Minimum iOS / tvOS deployment targets are unchanged (iOS 11, tvOS 11).
π Some context: this release heavily relies on where clauses on contextually generic declarations, that are only available in Swift 5.3 - SE-0267.
ViewModelMapping
is now a generic class, that captures view and model information(ViewModelMapping).
π Fixed
indentationLevelForCell
closure now correctly returnsInt
instead ofCGFloat
.- Several event API's have been improved to allow returning nil for methods, that accept nil as a valid value:
contextMenuConfiguration
,previewForHighlightingContextMenu
,previewForDismissingContextMenu
.
π Changed
- π Generic placeholders for cell/model/view methods have been improved for better readability.
π Deprecated
- Several cell/header/footer/supplementary view registration methods have been deprecated to unify registration logic. Please use
register(_:mapping:handler:)
,registerHeader(_:mapping:handler:)
,registerFooter(_:mapping:handler:)
as a replacements for all of those methods. For more information on those changes, please read [migration guide](Documentation/Migration%20guides/8.0%20Migration%20Guide.md). - All non-deprecated registration methods now have an additional
handler
closure, that allows to configure cells/headers/footers that are dequeued from UITableView. This is a direct replacement forconfigure(_:_:
,configureHeader(_:_:)
,configureFooter(_:_:)
, that are all now deprecated. Please note, that handler closure is called beforeDTModelTransfer.update(with:)
method. - π§
DTTableViewManager.configureEvents(for:_:)
, it's functionality has become unnecessary since mapping closure of cell/header/footer registration now captures both cell and model type information for such events. - π
DTTableViewManager.configureDiffableDataSource(modelProvider:)
for non-hashable data models. Please use configureDiffableDataSource method for models, that are Hashable. From Apple's documentation:If youβre working in a Swift codebase, always use UITableViewDiffableDataSource instead
. - β‘οΈ
TableViewUpdater.usesLegacyTableViewUpdateMethods
property.
-
v7.2.0 Changes
July 02, 2020π Changed
- π Deployment targets - iOS 11 / tvOS 11.
- Minimum Swift version required: 5.0
- β Added support for DTModelStorage/Realm with Realm 5
π Please note, that this framework version source is identical to previous version, which supports iOS 8 / tvOS 9 / Swift 4.0 and higher.
-
v7.1.0 Changes
April 29, 2020π Changed
- It's not longer necessary to import DTModelStorage framework to use it's API's.
import DTTableViewManager
now implicitly exportsDTModelStorage
.
- It's not longer necessary to import DTModelStorage framework to use it's API's.
-
v7.0.0 Changes
November 08, 2019- π
willCommitMenuWithAnimator
method has been made unavailable for Xcode 11.2, becauseUITableViewDelegate
method it used has been removed from UIKit on Xcode 11.2.
- π
-
v7.0.0-beta.2 Changes
September 06, 2019- β Added support for Xcode versions, that are older than Xcode 11.
-
v7.0.0-beta.1 Changes
August 20, 2019π This is a major release with some breaking changes, please read DTTableViewManager 7.0 Migration Guide
β Added
- π§
configureDiffableDataSource(modelProvider:)
method to enableUITableViewDiffableDataSource
withDTTableViewManager
. - Ability for
DTTableViewManageable
to implementtableView(_:viewForHeaderInSection:)
andtableView(_:viewForFooterInSection:)
to return view directly without going through storages. - π§
minimalHeaderHeightForTableView
andminimalFooterHeightForTableView
properties forTableViewConfiguration
, that allows configuring height for section headers and footers that need to be hidden. - 0οΈβ£ Ability to customize bundle, from which xib files are loaded from by setting
bundle
property onViewModelMapping
inmappingBlock
. As before,bundle
defaults toBundle(for: ViewClass.self)
. DTTableViewManager.supplementaryStorage
getter, that conditionally casts current storage toSupplementaryStorage
protocol.
π New method wrappers for iOS 13 API
shouldBeginMultipleSelectionInteraction
didBeginMultipleSelectionInteraction
didEndMultipleSelectionInteraction
contextMenuConfiguration(for:)
previewForHighlightingContextMenu
previewForDismissingContextMenu
willCommitMenuWithAnimator
π Changed
- If tableView section does not contain any items, and
TableViewConfiguration.display<Header/Footer>OnEmptySection
property is set to false,DTTableViewManager
no longer asks for header footer height explicitly and returnsTableViewConfiguration.minimal<Header/Footer>HeightForTableView
. - Anomaly event verification now allows subclasses to prevent false-positives.
- β‘οΈ
animateChangesOffScreen
property onTableViewUpdater
that allows to turn off animated updates forUITableView
when it is not on screen.
β Removed
- π Usage of previously deprecated and now removed from
DTModelStorage
ViewModelMappingCustomizing
protocol.
π₯ Breaking
DTModelStorage header, footer and supplementary model handling has been largely restructured to be a single closure-based API. Read more about changes in DTModelStorage changelog. As a result of those changes, several breaking changes in DTTableViewManager include:
- π
SupplementaryAccessible
extension withtableHeaderModel
andtableFooterModel
properties has been removed. - 0οΈβ£ Because headers/footers are now a closure based API,
setSectionHeaderModels
andsetSectionFooterModels
do not create sections by default, and do not call tableView.reloadData. - π§ If a storage does not contain any sections, even if
configuration.displayHeaderOnEmptySections
orconfiguration.displayFooterOnEmptySections
is set, headers and footers will not be displayed, since there are no sections, which is different from present sections, that contain 0 items. For example, If you need to show a header or footer in empty section using MemoryStorage, you can callmemoryStorage.setItems([Int](), forSectionAt: emptySectionIndex)
, and now with empty section header and footer can be displayed.
Other breaking changes:
- β‘οΈ
tableViewUpdater
will contain nil ifDTTableViewManager
is configured to work withUITableViewDiffableDataSource
. - π
DTTableViewOptionalManageable
protocol was removed and replaced byoptionalTableView
property onDTTableViewManageable
protocol. One oftableView
/optionalTableView
properties must be implemented byDTTableViewManageable
instance to work withDTTableViewManager
.
π Deprecated
π Following methods have been deprecated due to their delegate methods being deprecated in iOS 13:
editActions(for:)
shouldShowMenuForItemAt
canPerformAction
performAction
- π§
-
v6.6.0 Changes
June 17, 2019- β Added support for Swift Package Manager in Xcode 11
-
v6.5.0 Changes
April 07, 2019β Added
- Convenience constructor for
DTTableViewManager
object:init(storage:)
that allows to create it's instance without initializingMemoryStorage
. - π§ Static variable
defaultStorage
onDTTableViewManager
that allows to configure whichStorage
class is used by default. - π Documentation
- π Support for Xcode 10.2 and Swift 5
β Removed
- π Support for Xcode 9 and Swift 3
- Convenience constructor for
-
v6.4.0 Changes
September 25, 2018π Dependency changelog -> DTModelStorage 7.2.0 and higher
β Added
- Example of auto-diffing capability and animations when using
SingleSectionStorage
. - π Support for Swift 4.2 and Xcode 10.
π Changed
- β¬οΈ Reduced severity comment for
nilHeaderModel
andnilFooterModel
anomalies, since in some cases it's actually a desired behavior.
- Example of auto-diffing capability and animations when using