1.0.0 Release Candidate 2
This version Carbon supports both Swift 5.0 and Swift 5.1.
Breaking Changes
- Make
Adapter.alwaysRenderVisibleComponents
true by default. (#37) - Make
Component.shouldContentUpdate
returns false by default. (#37) - Constraints of type parameters
Adapter
inUITableViewUpdater
is now changed toUITableViewAdapter
. (#37)
- class CustomUpdater<A: Adapter & UITableViewDataSource & UITableViewDelegate>: UITableViewUpdater<A> {...}
+ class CustomUpdater<A: UITableViewAdapter>: UITableViewUpdater<A> {...}
- Constraints of type parameters
Adapter
inUICollectionViewUpdater
is now changed toUICollectionViewAdapter
. (#37)
- class CustomUpdater<A: Adapter & UICollectionViewDataSource & UICollectionViewDelegate>: UICollectionViewUpdater<A> {...}
+ class CustomUpdater<A: UITableViewAdapter>: UITableViewUpdater<A> {...}
Adapter.skipReloadComponents
is now obsolete. (#37)- Make
referenceSize(in bounds:)
returnsnil
by default. (#38) - Refactor method signature and responsibility of the
UITableViewUpdater/UICollectionViewUpdater
. (#40)
You can now intercepts arbitrary processes before or after updates, for example:
- override func performDifferentialUpdates(target: UITableView, adapter: A, data: [Section], stagedChangeset: StagedDataChangeset, completion: (() -> Void)?) {
}
+ super.performDifferentialUpdates(target: target, adapter: adapter, stagedChangeset: stagedDataChangeset)
open func performDifferentialUpdates(target: UITableView, adapter: Adapter, stagedChangeset: StagedDataChangeset) {
super.performDifferentialUpdates(target: target, adapter: adapter, stagedChangeset: stagedDataChangeset)
if stagedChangeset.allSatisfy({ $0.hasChanges }) {
let y = target.contentSize.height - (target.bounds.height - target.adjustedContentInset.bottom)
let contentOffset = CGPoint(x: target.contentOffset.x, y: y)
setContentOffset(contentOffset, animated: true)
}
}
- Remove
completion
fromRenderer
. (#40)
- renderer.completion {
- // do something
- }
+ renderer.updater.completion {
+ // do something
+ }
- Change constraints of type parameters Adapter of
UITableViewReloadDataUpdater/UICollectionReloadDataViewUpdater
toUITableViewAdapter/UICollectionViewAdapter
. (#40) - Closure style render function and section initializer are now deprecated. (#42)