Changelog History
Page 1
-
v10.0.0 Changes
β Added
- Wrappers for
collectionView:selectionFollowsFocusForItemAtIndexPath:
delegate method. - π Wrappers for iOS 15
UICollectionViewDelegate.collectionView(_:targetIndexPathForMoveOfItemFromOriginalIndexPath:atCurrentIndexPath:toProposedIndexPath:)
delegate method.
β Removed
- π Wrappers for
collectionView:willCommitMenuWithAnimator
delegate method, that was only briefly available in Xcode 12, and was removed by Apple in one of Xcode 12 releases.
π Changed
- π To align version numbers between
DTModelStorage
,DTTableViewManager
andDTCollectionViewManager
,DTCollectionViewManager
will not have 9.x release, instead it's being released as 10.x.
π Deprecated
- π
targetIndexPathForMovingItem
deprecated on iOS / tvOS 15 and higher, because delegate methodcollectionView:targetIndexPathForMoveFromItemAt:toProposedIndexPath:
was deprecated in favor of newer method.
- Wrappers for
-
v9.0.0-beta.1 Changes
π Fixed
- Diffable datasources exceptions in Xcode 13 / iOS 15 with some internal restructuring.
β Removed
- π Deprecated support for
UICollectionViewDiffableDataSourceReference
-
v8.2.0 Changes
π Changed
- π
UICollectionViewDatasource
.indexTitles(for:)
andUICollectionViewDatasource
.collectionView(_: indexPathForIndexTitle:at:)
methods and events now require iOS 14 (and seem to be working only on iOS 14) as per SDK changes in Xcode 12.5.
π Fixed
- β Xcode 12.5 / Swift 5.4 warnings
- Cell and supplementary view anomaly verification now correctly checks if corresponding subclasses respond to
init(frame:)
initializer.
- π
-
v8.1.0 Changes
π This release fixes a critical issue with cell and supplementary reuse on iOS 14 / tvOS 14. If you are using 8.x release, it's highly recommended to upgrade to this release.
π Changed
UICollectionView.CellRegistration
andUICollectionView.SupplementaryRegistration
on iOS 14 / tvOS 14 are now created once per mapping, thus properly allowing cell and supplementary reuse.
π Deprecated
DTCollectionViewManagerAnomaly.differentCellReuseIdentifier
. If you are using cells from code or from xib, please use empty reuseIdentifier, because on iOS 14 / tvOS 14 reuseIdentifiers are being set byUICollectionView.CellRegistration
object. If you are using storyboards, set reuseIdentifier of the cell to cell subclass name.
-
v8.0.1 Changes
π Fixed
- Typo, that caused anomalies to trigger when using events for UICollectionViewLayout(thanks, @RenGate).
-
v8.0.0 Changes
October 27, 2020β Added
- Registering events for
UICollectionViewDelegateFlowLayout
protocol now triggers an anomaly, if different layout class is used (for exampleUICollectionViewCompositionalLayout
)
- Registering events for
-
v8.0.0-beta.1 Changes
September 02, 2020π This is a major release with some breaking changes, please read DTCollectionViewManager 8.0 Migration Guide
π New
Cell and supplementary view events are now available inside mapping closure directly, for example:
// Previous releasesmanager.register(PostCell.self) manager.didSelect(PostCell.self) { cell, model, indexPath in// React to selection}// Newmanager.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 } }
It's now possible to register collection view cells, that don't conform to
DTModelTransfer
protocol:manager.register(UICollectionViewCell.self, String.self) { cell, indexPath, model in// configure cell with model which is of type String when passed into configuration closure.}
π§ This is particularly useful on iOS / tvOS 14 and higher, where you can configure
UICollectionViewListCell
without needing to subclass it.
π Cells, registered in this way, can safely coexist with cells, that conform toDTModelTransfer
protocol. Conditional mappings are also supported (multiple trailing closures syntax available in Swift 5.3):manager.register(UICollectionViewCell.self, for: String.self) { $0.condition = .section(0) } handler { cell, indexPath, model in// configure cell with model which is of type String when passed into configuration closure.}
- β Added event reaction for
UICollectionViewDelegate.collectionView(_:canEditItemAt:)
delegate method. - β Added event reactions for tvOS 13
TVCollectionViewDelegateFullScreenLayout
protocol fromTVUIKit
framework. - π New readme and in-depth documentation, split into several sections for developer convenience.
π Changed
- On iOS/tvOS 14 and higher, cell and supplementary views now use
UICollectionView.dequeueConfiguredReusableCell
andUICollectionView.dequeueConfiguredReusableSupplementary
to be dequeued. - β‘οΈ
DTModelTransfer
update(with:)
method for such cells and supplementary views is called immediately afterdequeueConfiguredReusableCell
\dequeueConfiguredReusableSupplementary
return. - π Generic placeholders for cell/model/view methods have been improved for better readability.
π₯ 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.
π§ Cells, headers and footers created in storyboard now need to be explicitly configured in view mapping:
register(StoryboardCell.self) { mapping in mapping.cellRegisteredByStoryboard = true}registerHeader(StoryboardHeader.self) { mapping in mapping.supplementaryRegisteredByStoryboard = true}
All non-deprecated registration methods now have an additional
handler
closure, that allows to configure cells/headers/footers/supplementary views that are dequeued from UICollectionView. This is a direct replacement forconfigure(_:_:
,configureHeader(_:_:)
,configureFooter(_:_:)
andconfigureSupplementary(_:ofKind:_:
, that are all now deprecated.β‘οΈ On iOS / tvOS 14 / Xcode 12 and higher handler closure, that is passed to registration methods, is used to call new
dequeueConfiguredReusableCell(using:for:item:)
anddequeueConfiguredReusableSupplementary(using:for:)
methods on UICollectionView. Please note, that handler closure is called beforeDTModelTransfer.update(with:)
method because of how new UICollectionView dequeue API works.ViewModelMapping
is now a generic class, that captures view and model information(ViewModelMapping<T,U>).β‘οΈ
CollectionViewUpdater.batchUpdatesInProgress
property was removed.
π 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:)
andregisterSupplementary(_:forKind:mapping:handler:)
as a replacements for all of those methods. For more information on those changes, please read migration guide - π§
DTCollectionViewManager.configureEvents(for:_:)
, it's functionality has become unnecessary since mapping closure of cell/supplementary registration now captures both cell and model type information for such events. - π
DTCollectionViewManager.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 UICollectionViewDiffableDataSource instead
.
π Fixed
- Supplementary views now correctly use
ViewModelMapping.reuseIdentifier
instead of falling back to name of the view class. - Several event API's have been improved to allow returning nil for methods, that accept nil as a valid value:
contextMenuConfiguration
,previewForHighlightingContextMenu
,previewForDismissingContextMenu
-
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.2 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 DTCollectionViewManager
now implicitly exportsDTModelStorage
as well.
- 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, becauseUICollectionViewDelegate
method it used has been removed from UIKit on Xcode 11.2.
- π