Skip to content

1.0.0 Release Candidate 2

Compare
Choose a tag to compare
@ra1028 ra1028 released this 04 Sep 19:11
· 67 commits to master since this release
0cffa13

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 in UITableViewUpdater is now changed to UITableViewAdapter. (#37)
- class CustomUpdater<A: Adapter & UITableViewDataSource & UITableViewDelegate>: UITableViewUpdater<A> {...}
+ class CustomUpdater<A: UITableViewAdapter>: UITableViewUpdater<A> {...}
  • Constraints of type parameters Adapter in UICollectionViewUpdater is now changed to UICollectionViewAdapter. (#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:) returns nil 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 from Renderer. (#40)
- renderer.completion {
-     // do something
- }

+ renderer.updater.completion {
+     // do something
+ }
  • Change constraints of type parameters Adapter of UITableViewReloadDataUpdater/UICollectionReloadDataViewUpdater to UITableViewAdapter/UICollectionViewAdapter. (#40)
  • Closure style render function and section initializer are now deprecated. (#42)

Enhancement

  • Adds support for Swift Package Manager (by @robcas3 #25)
  • UICollectionViewUpdater. renderVisibleComponents supports custom supplementary elements. (#37)
  • Add completion to UITableViewUpdater/UICollectionViewUpdater. (#40)