Releases: ra1028/Carbon
Releases · ra1028/Carbon
1.0.0 Release Candidate 6
1.0.0 Release Candidate 5
Enhancement
- Add support for SwiftUI compatibility 🎉 (#58)
struct HelloMessage: Component, View {
...
}
struct ContentView: View {
var body: some View {
ScrollView {
VStack {
Text("GREET")
.font(.title)
.padding(.horizontal, 16)
HelloMessage("World")
.frame(height: 60)
.background(Color.red)
}
}
}
}
- Add Group.init without elements (#50)
Breaking Changes
- Add
Component.intrinsicContentSize(for:)
to get intrinsic content size for content to infer size of the UIView in SwiftUI (#58)
1.0.0 Release Candidate 4
Enhancement
- Fix Package.swift (#49)
1.0.0 Release Candidate 3
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)
Enhancement
1.0.0 Release Candidate 1
This version Carbon supports both Swift 5.0 and Swift 5.1.
Features
- Add support for use custom container cell/header/footer class (#21)
- Add closure style initializer for
Section
(#28) - Add a render function with closure style builder (#28)
- Add completion closure property to
Renderer
(#28)
Breaking Changes
0.3.0
This version Carbon supports both Swift 4.2 and Swift 5.
Features
- Add
isAnimationEnabledWhileScrolling
option for disable animation while scrolling (#17) - Initializing
Renderer
without passing the target instance (#18)
let renderer = Renderer(
adapter: UITableViewAdapter(),
updater: UITableViewUpdater()
)
renderer.target = tableView
Deprecation
Renderer.init(target:adapter:updater:)
is now deprecated. UseRenderer.init(adapter:updater:)
instead (#18)