diff --git a/Carbon.podspec b/Carbon.podspec index 1ed311c..213144a 100644 --- a/Carbon.podspec +++ b/Carbon.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'Carbon' - spec.version = '0.2.0' + spec.version = '0.3.0' spec.author = { 'ra1028' => 'r.fe51028.r@gmail.com' } spec.homepage = 'https://github.com/ra1028/Carbon' spec.documentation_url = 'https://ra1028.github.io/Carbon' @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.source_files = 'Sources/**/*.swift' spec.license = { :type => 'Apache 2.0', :file => 'LICENSE' } spec.requires_arc = true - spec.swift_version = '4.2' + spec.swift_versions = ['4.2', '5.0'] spec.ios.deployment_target = '10.0' spec.dependency 'DifferenceKit/Core', "~> 1.1" spec.ios.frameworks = 'UIKit' diff --git a/Gemfile b/Gemfile index d6d1149..9074cfb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source "https://rubygems.org" -gem 'cocoapods', '1.6.1' +gem 'cocoapods', '1.7.0.rc.1' gem 'jazzy', '0.9.4' diff --git a/Gemfile.lock b/Gemfile.lock index 3d15ae1..fa394b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,11 +9,11 @@ GEM tzinfo (~> 1.1) atomos (0.1.3) claide (1.0.2) - cocoapods (1.6.1) + cocoapods (1.7.0.rc.1) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.6.1) - cocoapods-deintegrate (>= 1.0.2, < 2.0) + cocoapods-core (= 1.7.0.rc.1) + cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) @@ -27,12 +27,12 @@ GEM molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.8.1, < 2.0) - cocoapods-core (1.6.1) + xcodeproj (>= 1.8.2, < 2.0) + cocoapods-core (1.7.0.rc.1) activesupport (>= 4.0.2, < 6) fuzzy_match (~> 2.0.4) nap (~> 1.0) - cocoapods-deintegrate (1.0.3) + cocoapods-deintegrate (1.0.4) cocoapods-downloader (1.2.2) cocoapods-plugins (1.0.0) nap @@ -74,18 +74,18 @@ GEM redcarpet (3.4.0) rouge (3.3.0) ruby-macho (1.4.0) - sass (3.7.3) + sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sqlite3 (1.4.0) + sqlite3 (1.4.1) thread_safe (0.3.6) tzinfo (1.2.5) thread_safe (~> 0.1) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.8.1) + xcodeproj (1.9.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -96,7 +96,7 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.6.1) + cocoapods (= 1.7.0.rc.1) jazzy (= 0.9.4) BUNDLED WITH diff --git a/Makefile b/Makefile index 100ed65..492f9d8 100644 --- a/Makefile +++ b/Makefile @@ -11,4 +11,4 @@ lib-lint: bundle exec pod lib lint pod-release: - bundle exec pod trunk push + bundle exec pod trunk push --allow-warnings diff --git a/README.md b/README.md index 3b99af6..5639656 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,16 @@ in UITableView and UICollectionView.
Lincense

+

+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( ) ``` +

+[See More Usage] +

+ --- ## Advanced Guide @@ -389,12 +393,35 @@ Invoked every time of after a component went out from visible area. #### Adapter Customization -You can add methods of `Delegate`, `DataSource` by inheriting each adapter. +You can add methods of `delegate`, `dataSource` by subclassing each adapter. + +```swift +class CustomTableViewdapter: UITableViewAdapter { + func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { + return "Header title for section\(section)" + } +} + +let renderer = Renderer( + adapter: CustomTableViewAdapter(), + 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`. - **config** The configuration which having the classes of elements. It can be specified only when adapter is initialized. +```swift +let config = UITableViewAdapter.Config( + cellClass: CustomCell.self, + headerViewClass: CustomHeaderView.self, + footerViewClass: CustomFooterView.self +) +let adapter = UITableViewAdapter(config: config) +``` + [See more](https://ra1028.github.io/Carbon/Adapters.html) #### Updater Customization @@ -459,11 +486,7 @@ We recommend to do implementation that doesn't count on this protocols. ### [CocoaPods](https://cocoapods.org) Add the following to your `Podfile`: ```ruby -use_frameworks! - -target 'TargetName' do - pod 'Carbon' -end +pod 'Carbon' ``` ### [Carthage](https://github.com/Carthage/Carthage) diff --git a/docs/index.html b/docs/index.html index 31668a7..92820e3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -211,6 +211,10 @@

Lincense

+

+Made with ❤️ by Ryo Aoyama +

+
@@ -227,10 +231,6 @@

-

-Made with ❤️ by Ryo Aoyama -

-

Introduction

@@ -240,7 +240,7 @@

Introduction

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.


Examples

@@ -333,7 +333,7 @@

CellNode

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.