Releases: DenTelezhkin/DTTableViewManager
Releases · DenTelezhkin/DTTableViewManager
6.1.0-beta.1
- Implemented new system for deferring datasource updates until
performBatchUpdates
block. This system is intended to fight crash, that might happen whenperformBatchUpdates
method is called afterUITableView.reloadData
method(for example after callingmemoryStorage.setItems
, and then immediatelymemoryStorage.addItems
). This issue is detailed in DenTelezhkin/DTCollectionViewManager#27 and DenTelezhkin/DTCollectionViewManager#23. This crash can also happen, if iOS 11 APIUITableView.performBatchUpdates
is used. This system is turned on by default. If, for some reason, you want to disable it and have old behavior, call:
manager.memoryStorage.defersDatasourceUpdates = false
TableViewUpdater
now uses iOS 11performBatchUpdates
API, if this API is available. This API will work properly onMemoryStorage
only ifdefersDatasourceUpdates
is set totrue
- which is default. However, if for some reason you need to use legacy methodsbeginUpdates
,endUpdates
, you can enable them like so:
manager.tableViewUpdater?.usesLegacyTableViewUpdateMethods = true
Please note, though, that new default behavior is recommended, because it is more stable and works the same on both UITableView and UICollectionView.
tableViewUpdater
property onDTTableViewManager
is now ofTableViewUpdater
type instead of opaqueStorageUpdating
type. This should ease use of this object and prevent type unneccessary type casts.
6.0.0
- Updated to Xcode 9.1 / Swift 4.0.2
6.0.0-beta.3
- Makes
DTTableViewManager
property weak instead of unowned to prevent iOS 10-specific memory issues/crashes.
6.0.0-beta.2
- Build with Xcode 9.0 final release.
- Fixed partial-availability warnings.
6.0.0-beta.1
This is a major release with some breaking changes, please read DTTableViewManager 6.0 Migration Guide
- Added
updateVisibleCells(_:) method
, that allows updating cell data for visible cells with callback on each cell. This is more efficient than callingreloadData
when number of elements inUITableView
does not change, and only contents of items change. - Implement
configureEvents(for:_:)
method, that allows batching in several cell events to avoid using T.ModelType for events, that do not have cell created. - Added event for
UITableViewDelegate
tableView(_:targetIndexPathForMoveFromRowAt:toProposedIndexPath:
- Added events for focus engine on iOS 9
- Added events for iOS 11
UITableViewDelegate
methods:tableView(_:leadingSwipeActionsConfigurationForRowAt:
,tableView(_:trailingSwipeActionsConfigurationForRowAt:
,tableView(_:shouldSpringLoadRowAt:withContext:
UITableViewDelegate
andUITableViewDatasource
implementations have been refactored fromDTTableViewManager
toDTTableViewDelegate
andDTTableViewDataSource
classes.DTTableViewManager
now allows registering mappings for specific sections, or mappings with any custom condition.- Added
move(_:_:)
method to allow setting up events, reacting totableView:moveRowAt:to:
method.
Breaking
- Signature of
move(_:_:)
method has been changed to make it consistent with other events. Arguments received in closure are now:(destinationIndexPath: IndexPath, cell: T, model: T.ModelType, sourceIndexPath: IndexPath)
tableView(UITableView, moveRowAt: IndexPath, to: IndexPath)
no longer automatically moves items, if current storage isMemoryStorage
. Please useMemoryStorage
convenience methodmoveItemWithoutAnimation(from:to:)
to move items manually.
Deprecated
- Error handling system of
DTTableViewManager
is deprecated and can be removed or replaced in future versions of the framework.
5.3.0
- Use new events system from
DTModelStorage
, that allows events to be properly called for cells, that are created usingViewModelMappingCustomizing
protocol.
5.2.0
New
- Setting
TableViewUpdater
instance totableViewUpdater
property onDTTableViewManager
now triggersdidUpdateContent
closure onTableViewUpdater
. - Added
sectionIndexTitles
event to replaceUITableViewDataSource.sectionIndexTitles(for:)
method. - Added
sectionForSectionIndexTitle
event to replaceUITableViewDataSource.tableView(_:sectionForSectionIndexTitle:at)
method.
Bugfixes
- All events that return Optional value now accept nil as a valid event result.
didDeselect(_:,_:)
method now accepts closure without return type - sinceUITableViewDelegate
does not have return type in that method.
5.1.0
Dependency changelog -> DTModelStorage 4.0.0 and higher
TableViewUpdater
has been rewritten to use newStorageUpdate
properties that track changes in order of their occurence.TableViewUpdater
reloadRowClosure
andDTTableViewManager
updateCellClosure
now accept indexPath and model instead of just indexPath. This is done because update may happen after insertions and deletions and object that needs to be updated may exist on different indexPath.
5.0.0
No changes from previous beta.
5.0.0-beta.3
DTModelStorage
dependency now requiresRealm 2.0
UITableViewDelegate
heightForHeaderInSection
andheightForFooterInSection
are now properly called on the delegate, if it implements it(thanks, @augmentedworks!).