Carbon v1.0.0-rc.2 Release Notes

Release Date: 2019-09-04 // almost 3 years ago
  • 👍 This version Carbon supports both Swift 5.0 and Swift 5.1.

    💥 Breaking Changes

    • 0️⃣ 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)

    • 0️⃣ 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)