Change Log

All notable changes to this project will be documented in this file.

Next

11.0.0

Added

manager.registerHostingConfiguration(for: Post.self) { _, post, _ in
    UIHostingConfiguration {
        PostView(post: post)
    }
}

It's also possible to incorporate UIKit cell states by simply adding additional parameter to registration:

manager.registerHostingConfiguration(for: Post.self) { state, _, post, _ in
    UIHostingConfiguration {
        PostView(post: post, isSelected: state.isSelected)
    }
}
manager.register(PostCell.self) { mapping in
    mapping.prefetch { model, indexPath in }
    mapping.cancelPrefetch { model, indexPath in }
}

Please note, that while datasource methods are called once per array of indexPaths, events for models will be called individually, so single model (and indexPath) is passed to each event. Theoretically, this should make prefetching and cancellation easier, since you no longer need to walk through array and find all data models, you can operate on a single data model at a time.

Deprecated

Deprecated:

    manager.register(PostCell.self)
    manager.didSelect(PostCell.self) { postCell, post, indexPath in }

Recommended:

    manager.register(PostCell.self) { mapping in
        mapping.didSelect { postCell, post, indexPath in }
    }

While previously main benefits for second syntax were mostly syntactic, now with support for SwiftUI it will be hard to actually specialize hosting cells (and might be impossible when iOS 16 hosting configuration is supported), so only second syntax will work for all kinds of cells, and first syntax can only work for non-SwiftUI cells. New delegate methods for UITableView (starting with iOS 16 / tvO 16 SDK) will be added only as extension to mapping protocols, not DTTableViewManager itself.

11.0.0-beta.1

Introducing support for SwiftUI!

Registering SwiftUI views as content for table view cells:

manager.registerHostingCell(for: Post.self) { model, indexPath in
    PostSwiftUIView(model: model)
}

This method is supported on iOS 13+ / tvOS 13+ / macCatalyst 13+.

Please note, that this integration is not supported by Apple, therefore it comes with several workarounds, read more about those in SwiftUI support document

Added

Changed

Breaking

10.0.0

Added

Changed

Removed

9.0.0-beta.1

Removed

Fixed

8.0.1

Added

8.0.0

8.0.0-beta.1

Added

// 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.

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:

  1. Your DTTableViewManageable instance implements them
  2. You register a heightForHeader(withItem:_:) or heightForFooter(withItem:_:) closures on DTTableViewManager 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.

Fixed

Changed

Deprecated

7.2.0

Changed

Please note, that this framework version source is identical to previous version, which supports iOS 8 / tvOS 9 / Swift 4.0 and higher.

7.1.0

Changed

7.0.0

7.0.0-beta.2

7.0.0-beta.1

This is a major release with some breaking changes, please read DTTableViewManager 7.0 Migration Guide

Added

New method wrappers for iOS 13 API

Changed

Removed

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:

Other breaking changes:

Deprecated

Following methods have been deprecated due to their delegate methods being deprecated in iOS 13:

6.6.0

6.5.0

Added

Removed

6.4.0

Dependency changelog -> DTModelStorage 7.2.0 and higher

Added

Changed

6.3.0

Added

Changed

Breaking

6.2.0

6.1.1

6.1.0

6.1.0-beta.1

manager.memoryStorage.defersDatasourceUpdates = false
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.

6.0.0

6.0.0-beta.3

6.0.0-beta.2

6.0.0-beta.1

This is a major release with some breaking changes, please read DTTableViewManager 6.0 Migration Guide

Breaking

Deprecated

5.3.0

Dependency changelog -> DTModelStorage 5.0.0 and higher

5.2.0

New

Bugfixes

5.1.0

Dependency changelog -> DTModelStorage 4.0.0 and higher

5.0.0

No changes

5.0.0-beta.3

5.0.0-beta.2

Added

5.0.0-beta.1

This is a major release, written in Swift 3. Read Migration guide with descriptions of all features and changes.

Dependency changelog -> DTModelStorage 3.0.0 and higher

Added

Changed

Removals

4.8.0

Changed

4.7.0

Dependency changelog -> DTModelStorage 2.6.0 and higher

4.6.0

Dependency changelog -> DTModelStorage 2.5 and higher

Breaking

Changed

4.5.3

Fixed

4.5.0

Added

    manager.dataBindingBehaviour = .BeforeCellIsDisplayed

Changed

4.4.1

Fixed

4.4.0

Dependency changelog -> DTModelStorage 2.3 and higher

This release aims to improve mapping system and error reporting.

Added

Changed

4.3.0

Dependency changelog -> DTModelStorage 2.2 and higher

Changed

Fixed

Renamed

Removed

4.2.1

Updated

4.2.0

Dependency changelog -> DTModelStorage 2.1 and higher

This release aims to improve storage updates and UI animation with UITableView. To make this happen, DTModelStorage classes were rewritten and rearchitectured, using Swift Set.

There are some backwards-incompatible changes in this release, however Xcode quick-fix tips should guide you through what needs to be changed.

Added

Fixed

4.1.0

Features

New events registration system with method pointers, that automatically breaks retain cycles.

For example, cell selection:

manager.cellSelection(PostsViewController.selectedCell)

func selectedCell(cell: PostCell, post: Post, indexPath: NSIndexPath) {
    // Do something, push controller probably?
}

Alternatively, you can use dynamicType to register method pointer:

manager.cellSelection(self.dynamicType.selectedCell)

Other available events:

Breaking changes

beforeContentUpdate and afterContentUpdate closures were replaced with DTTableViewContentUpdatable protocol, that can be adopted by your DTTableViewManageable class, for example:

extension PostsViewController: DTTableViewContentUpdatable {
    func afterContentUpdate() {
        // Do something
    }
}

4.0.0

4.0 is a next major release of DTTableViewManager. It was rewritten from scratch in Swift 2 and is not backwards-compatible with previous releases.

Read 4.0 Migration guide.

Features

3.2.0

Bugfixes

3.1.1

3.1.0

Changes

3.0.5

Features

Added removeAllTableItemsAnimated method.

Bugfixes

Fixed issue, that could lead to wrong table items being removed, when using memory storage removeItemsAtIndexPaths: method.

3.0.2

Changes

3.0.0

Features

Breaking changes

2.7.0

This is a release, that is targeted at improving code readability, and reducing number of classes and protocols inside DTTableViewManager architecture.

Breaking changes

Features

2.5.0

Changes

Preliminary support for Swift.

If you use cells, headers or footers inside storyboards from Swift, implement optional reuseIdentifier method to return real Swift class name instead of the mangled one. This name should also be set as reuseIdentifier in storyboard.

2.4.0

Breaking changes

Reuse identifier now needs to be identical to cell, header or footer class names. For example, UserTableCell should now have "UserTableCell" reuse identifier.

2.3.0

Features

Added properties of DTTableViewController to control, whether section headers and footers should be shown for sections, that don't contain any items.

Deprecations

Removed DTModelSearching protocol, please use DTMemoryStorage setSearchingBlock:forModelClass: method instead.

2.2.0

2.1.0

Breaking changes

Storage classes now use external dependency from DTModelStorage repo.

Some method calls on memory storage have been renamed, dropping 'table' part from the name, for example

-(void)addTableItems:(NSArray *)items

now becomes

-(void)addItems:(NSArray *)items

Several protocols and classes have been also renamed:

DTTableViewModelTransfer - DTModelTransfer DTTableViewModelSearching - DTModelSearching DTTableViewCoreDataStorage - DTCoreDataStorage

Features

Added support for default UITableViewCellStyles and default UITableViewHeaderFooterViews without subclassing.

2.0.0

DTTableViewManager 2.0 is a major update to the framework with several API - breaking changes. Please read DTTableViewManager 2.0 transition guide for an overview.

1.3.0

Features

Added support for storyboard prototype cells.

Enhancements

DTTableViewManager renamed to DTTableViewController.

Bugfixes

Fixed bug, which prevented using correct height values on custom headers and footers.

1.2.1

Features

Added ability to disable logging

Enhancements

Improved structure of mapping code, now mapping and cell creation happens completely in DTCellFactory class.

1.2.0

Features

Introducing support for Foundation data models. Cell, header and footer mapping now supports following classes:

Deprecations

1.1.0

Features

Powerful and easy search within UITableView.

General changes

Tests are now running on Travis-CI

Deprecations

Ability to create DTTableViewManager as a separate object was removed. If you need to subclass from different UIViewController, consider using iOS Containment API.