From d189cbb8bfe47118c379064d90633eaf4721d1fc Mon Sep 17 00:00:00 2001
From: Ryo Aoyama
+Made with ❤️ by Ryo Aoyama +
+ --- |Declarative|Component-Based|Non-Destructive| |:----------|:--------------|:--------------| |Provides a declarative design with power of diffing algorithm for building list UIs.|Declare component once, it can be reused regardless kind of the list element.|Solves the various problems by architecture and algorithm without destructing UIKit.| --Made with ❤️ by Ryo Aoyama -
- --- ## Introduction @@ -37,7 +37,7 @@ This make it painless to build and maintain the complex UIs. Uses [DifferenceKit](https://github.com/ra1028/DifferenceKit) which is highly optimized based on Paul Heckel's paper for diffing. Declarative design and diffing algorithm make your code more predictable, debugging easier and providing beautiful animations to users. -Our goal is similar to [IGListKit](https://github.com/Instagram/IGListKit) and [Epoxy](https://github.com/airbnb/epoxy), we respect those library as pioneers. +Our goal is similar to [Instagram/IGListKit](https://github.com/Instagram/IGListKit) and [airbnb/Epoxy](https://github.com/airbnb/epoxy), we respect those library as pioneers. --- @@ -75,7 +75,7 @@ renderer.render( #### Build for Development -```bash +```sh $ git clone https://github.com/ra1028/Carbon.git $ cd Carbon/ $ make setup @@ -134,7 +134,7 @@ ViewNode(HelloMessage(name: "Vincent")) `CellNode` is a node representing cell. Unlike in the ViewNode, this needs an `id` which `Hashable` type to identify from among a lot of cells. -The `id` is used to find the same component in the list data before and after changed, then calculate the following kind of diff. +The `id` is used to find the same component in the list data before and after changed, then calculate the all kind of diff. - deletes - inserts - moves @@ -154,7 +154,7 @@ CellNode(HelloMessage(name: "Jules")) `Section` has a header, a footer and a group of cells. A group of cells can be contains nil, then skipped rendering of it cell. -This also needs to specify `id` for identify from among multiple sections, then can be calculate the several kind of diff. +This also needs to specify `id` for identify from among multiple sections, then can be calculate the all kind of diff. - section deletes - section inserts - section moves @@ -246,6 +246,10 @@ renderer.render( ) ``` ++Made with ❤️ by Ryo Aoyama +
+-Made with ❤️ by Ryo Aoyama -
-Uses DifferenceKit which is highly optimized based on Paul Heckel’s paper for diffing.
Declarative design and diffing algorithm make your code more predictable, debugging easier and providing beautiful animations to users.
Our goal is similar to IGListKit and Epoxy, we respect those library as pioneers.
+Our goal is similar to Instagram/IGListKit and airbnb/Epoxy, we respect those library as pioneers.
CellNode
is a node representing cell.
Unlike in the ViewNode, this needs an id
which Hashable
type to identify from among a lot of cells.
-The id
is used to find the same component in the list data before and after changed, then calculate the following kind of diff.
id
is used to find the same component in the list data before and after changed, then calculate the all kind of diff.
Section
has a header, a footer and a group of cells.
A group of cells can be contains nil, then skipped rendering of it cell.
-This also needs to specify id
for identify from among multiple sections, then can be calculate the several kind of diff.
id
for identify from among multiple sections, then can be calculate the all kind of diff.
You can add methods of Delegate
, DataSource
by inheriting each adapter.
-Furthermore, it can be customized the class of the elements(cell/header/footer) which becomes the container of component by setting it to config
.
You can add methods of delegate
, dataSource
by subclassing each adapter.
class CustomTableViewdapter: UITableViewAdapter {
+ func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
+ return "Header title for section\(section)"
+ }
+}
+
+let renderer = Renderer(
+ adapter: CustomTableViewdapter(),
+ updater: UITableViewUpdater()
+)
+
+
+Furthermore, it can be customized the class of the elements(cell/header/footer) which becomes the container of component by setting it to config
.
let config = UITableViewAdapter.Config(
+ cellClass: CustomCell.self,
+ headerViewClass: CustomHeaderView.self,
+ footerViewClass: CustomFooterView.self
+)
+let adapter = UITableViewAdapter(config: config)
+
Add the following to your Podfile
:
use_frameworks!
-
-target 'TargetName' do
- pod 'Carbon'
-end
+pod 'Carbon'
Carthage
From 5a482621489ec98c24fcd0b9e2d9940ff9fcdc0c Mon Sep 17 00:00:00 2001
From: Ryo Aoyama
Date: Tue, 14 May 2019 02:44:35 +0900
Subject: [PATCH 7/7] Fix typo in README
---
README.md | 2 +-
docs/index.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 6e9063a..5639656 100644
--- a/README.md
+++ b/README.md
@@ -403,7 +403,7 @@ class CustomTableViewdapter: UITableViewAdapter {
}
let renderer = Renderer(
- adapter: CustomTableViewdapter(),
+ adapter: CustomTableViewAdapter(),
updater: UITableViewUpdater()
)
```
diff --git a/docs/index.html b/docs/index.html
index 5bf8b69..92820e3 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -571,7 +571,7 @@ Adapter Customization
}
let renderer = Renderer(
- adapter: CustomTableViewdapter(),
+ adapter: CustomTableViewAdapter(),
updater: UITableViewUpdater()
)