Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ra1028 committed Jul 28, 2019
1 parent 55eafa3 commit b89cc54
Show file tree
Hide file tree
Showing 20 changed files with 391 additions and 191 deletions.
12 changes: 4 additions & 8 deletions Carbon.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
6B1BE6B722E5CA0D0054DB46 /* ComponentRenderable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B1BE6B622E5CA0D0054DB46 /* ComponentRenderable.swift */; };
6B5304532201EDB200A3E21E /* DataChangeset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B5304522201EDB200A3E21E /* DataChangeset.swift */; };
6B6594A421E2532100291AAF /* IdentifiableComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B65948621E2532100291AAF /* IdentifiableComponent.swift */; };
6B6594A521E2532100291AAF /* ComponentContainerElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B65948821E2532100291AAF /* ComponentContainerElement.swift */; };
6B6594A621E2532100291AAF /* UICollectionViewAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B65948A21E2532100291AAF /* UICollectionViewAdapter.swift */; };
6B6594A721E2532100291AAF /* UITableViewAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B65948B21E2532100291AAF /* UITableViewAdapter.swift */; };
6B6594A921E2532100291AAF /* Adapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B65948D21E2532100291AAF /* Adapter.swift */; };
Expand Down Expand Up @@ -48,7 +48,6 @@
6B7ADEE121FBA6D1003803BE /* ComponentContainerElementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7ADEE021FBA6D1003803BE /* ComponentContainerElementTests.swift */; };
6B7EED9E224CA5DD00060872 /* UIScrollViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9D224CA5DD00060872 /* UIScrollViewExtensions.swift */; };
6B7EEDA0224CE4E100060872 /* UIScrollViewExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9F224CE4E000060872 /* UIScrollViewExtensionsTests.swift */; };
6BAEA3DA2289C5D10026F81E /* Availability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BAEA3D92289C5D10026F81E /* Availability.swift */; };
6BAEA43D228D4E920026F81E /* RuntimeAssociation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BAEA43C228D4E920026F81E /* RuntimeAssociation.swift */; };
/* End PBXBuildFile section */

Expand All @@ -63,10 +62,10 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
6B1BE6B622E5CA0D0054DB46 /* ComponentRenderable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentRenderable.swift; sourceTree = "<group>"; };
6B5304522201EDB200A3E21E /* DataChangeset.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataChangeset.swift; sourceTree = "<group>"; };
6B65947A21E252E300291AAF /* Carbon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Carbon.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6B65948621E2532100291AAF /* IdentifiableComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IdentifiableComponent.swift; sourceTree = "<group>"; };
6B65948821E2532100291AAF /* ComponentContainerElement.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentContainerElement.swift; sourceTree = "<group>"; };
6B65948A21E2532100291AAF /* UICollectionViewAdapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UICollectionViewAdapter.swift; sourceTree = "<group>"; };
6B65948B21E2532100291AAF /* UITableViewAdapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITableViewAdapter.swift; sourceTree = "<group>"; };
6B65948D21E2532100291AAF /* Adapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Adapter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -108,7 +107,6 @@
6B7ADEE021FBA6D1003803BE /* ComponentContainerElementTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComponentContainerElementTests.swift; sourceTree = "<group>"; };
6B7EED9D224CA5DD00060872 /* UIScrollViewExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIScrollViewExtensions.swift; sourceTree = "<group>"; };
6B7EED9F224CE4E000060872 /* UIScrollViewExtensionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIScrollViewExtensionsTests.swift; sourceTree = "<group>"; };
6BAEA3D92289C5D10026F81E /* Availability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Availability.swift; sourceTree = "<group>"; };
6BAEA43C228D4E920026F81E /* RuntimeAssociation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeAssociation.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -163,7 +161,6 @@
6B65949021E2532100291AAF /* Section.swift */,
6B6594A321E2532100291AAF /* Renderer.swift */,
6B5304522201EDB200A3E21E /* DataChangeset.swift */,
6BAEA3D92289C5D10026F81E /* Availability.swift */,
6B65948921E2532100291AAF /* Adapters */,
6B65949221E2532100291AAF /* Updaters */,
6B65949D21E2532100291AAF /* Interfaces */,
Expand Down Expand Up @@ -208,7 +205,7 @@
6B65949D21E2532100291AAF /* Interfaces */ = {
isa = PBXGroup;
children = (
6B65948821E2532100291AAF /* ComponentContainerElement.swift */,
6B1BE6B622E5CA0D0054DB46 /* ComponentRenderable.swift */,
6B65949F21E2532100291AAF /* UITableViewComponentCell.swift */,
6B6594A121E2532100291AAF /* UITableViewComponentHeaderFooterView.swift */,
6B6594A021E2532100291AAF /* UICollectionViewComponentCell.swift */,
Expand Down Expand Up @@ -421,7 +418,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6BAEA3DA2289C5D10026F81E /* Availability.swift in Sources */,
6B6594BB21E2532100291AAF /* UITableViewComponentHeaderFooterView.swift in Sources */,
6B7EED9E224CA5DD00060872 /* UIScrollViewExtensions.swift in Sources */,
6B6594AC21E2532100291AAF /* Section.swift in Sources */,
Expand All @@ -440,8 +436,8 @@
6B6594B221E2532100291AAF /* UICollectionViewUpdater.swift in Sources */,
6B6594B021E2532100291AAF /* Updater.swift in Sources */,
6B6594BD21E2532100291AAF /* Renderer.swift in Sources */,
6B6594A521E2532100291AAF /* ComponentContainerElement.swift in Sources */,
6B6594B921E2532100291AAF /* UITableViewComponentCell.swift in Sources */,
6B1BE6B722E5CA0D0054DB46 /* ComponentRenderable.swift in Sources */,
6B5304532201EDB200A3E21E /* DataChangeset.swift in Sources */,
6B6594BA21E2532100291AAF /* UICollectionViewComponentCell.swift in Sources */,
6B6594B521E2532100291AAF /* AnyComponent.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example-iOS/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

gem 'cocoapods', '1.7.0.rc.2'
gem 'cocoapods', '1.7.5'
16 changes: 8 additions & 8 deletions Examples/Example-iOS/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ GEM
tzinfo (~> 1.1)
atomos (0.1.3)
claide (1.0.2)
cocoapods (1.7.0.rc.2)
cocoapods (1.7.5)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.7.0.rc.2)
cocoapods-core (= 1.7.5)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
Expand All @@ -22,13 +22,13 @@ GEM
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.2.0, < 3.0)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.8.2, < 2.0)
cocoapods-core (1.7.0.rc.2)
xcodeproj (>= 1.10.0, < 2.0)
cocoapods-core (1.7.5)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
Expand All @@ -45,7 +45,7 @@ GEM
colored2 (3.1.2)
concurrent-ruby (1.1.5)
escape (0.0.4)
fourflusher (2.2.0)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
i18n (0.9.5)
Expand All @@ -59,7 +59,7 @@ GEM
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
xcodeproj (1.9.0)
xcodeproj (1.11.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -70,7 +70,7 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.7.0.rc.2)
cocoapods (= 1.7.5)

BUNDLED WITH
2.0.1
3 changes: 2 additions & 1 deletion Examples/Example-iOS/Podfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source 'https://cdn.cocoapods.org/'
platform :ios, '12.2'

use_frameworks!
Expand All @@ -7,6 +8,6 @@ ENV['COCOAPODS_DISABLE_STATS'] = 'true'

target 'Example-iOS' do
pod 'Carbon', path: '../../'
pod 'MagazineLayout', '1.4.5'
pod 'MagazineLayout', '1.5.0'
pod 'SwipeCellKit', '2.6.0'
end
16 changes: 8 additions & 8 deletions Examples/Example-iOS/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
PODS:
- Carbon (0.3.0):
- DifferenceKit/Core (~> 1.1)
- DifferenceKit/Core (1.1.2)
- MagazineLayout (1.4.5)
- DifferenceKit/Core (1.1.3)
- MagazineLayout (1.5.0)
- SwipeCellKit (2.6.0)

DEPENDENCIES:
- Carbon (from `../../`)
- MagazineLayout (= 1.4.5)
- MagazineLayout (= 1.5.0)
- SwipeCellKit (= 2.6.0)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
https://cdn.cocoapods.org/:
- DifferenceKit
- MagazineLayout
- SwipeCellKit
Expand All @@ -22,10 +22,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Carbon: 6badf3ea143008d086fadb91318fab09a088a5e1
DifferenceKit: 3a1cff9ac9a9cdf2a3f205671067797e83c3f066
MagazineLayout: dcd0e08fbda3f891c77b88bd43997f298e8d496a
DifferenceKit: 5018791b6c1fc839921a3c171a0a539ace6ea60c
MagazineLayout: fe41dc2cf1923e3bf377cd8d906a4455a0bf9c83
SwipeCellKit: 935ca28c187ec6e1ffb2b578cf8ddca842bfdcbb

PODFILE CHECKSUM: 44ebdd4078910db619cba5ab42b20bcf7482430c
PODFILE CHECKSUM: be830e3243aec6afdc78b16a82166efd1db3cb52

COCOAPODS: 1.7.0.rc.2
COCOAPODS: 1.7.5
20 changes: 10 additions & 10 deletions Examples/Example-iOS/Sources/Kyoto/KyotoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@ final class KyotoViewController: UIViewController {
extension MagazineLayoutCollectionViewCell: ComponentRenderable {}

final class MagazineLayoutKyotoAdapter: UICollectionViewAdapter, UICollectionViewDelegateMagazineLayout {
override func viewNode(forSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> ViewNode? {
override func componentCellClass(collectionView: UICollectionView, indexPath: IndexPath, node: CellNode) -> (UICollectionViewCell & ComponentRenderable).Type {
return MagazineLayoutCollectionViewCell.self
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeModeForItemAt indexPath: IndexPath) -> MagazineLayoutItemSizeMode {
return MagazineLayoutItemSizeMode(widthMode: .halfWidth, heightMode: .static(height: 150))
}

override func supplementaryViewNode(forElementKind kind: String, at indexPath: IndexPath) -> ViewNode? {
switch kind {
case MagazineLayout.SupplementaryViewKind.sectionHeader:
return headerNode(in: indexPath.section)
Expand All @@ -69,18 +77,10 @@ final class MagazineLayoutKyotoAdapter: UICollectionViewAdapter, UICollectionVie
return footerNode(in: indexPath.section)

default:
return super.viewNode(forSupplementaryElementOfKind: kind, at: indexPath)
return super.supplementaryViewNode(forElementKind: kind, at: indexPath)
}
}

override func containerCellClass(collectionView: UICollectionView, indexPath: IndexPath, node: CellNode) -> (UICollectionViewCell & ComponentRenderable).Type {
return MagazineLayoutCollectionViewCell.self
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeModeForItemAt indexPath: IndexPath) -> MagazineLayoutItemSizeMode {
return MagazineLayoutItemSizeMode(widthMode: .halfWidth, heightMode: .static(height: 150))
}

func collectionView(
_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example-iOS/Sources/Todo/TodoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ final class TodoViewController: UIViewController, UITextViewDelegate {
extension SwipeTableViewCell: ComponentRenderable {}

final class SwipeCellKitTodoAdapter: UITableViewAdapter, SwipeTableViewCellDelegate {
override func containerCellClass(tableView: UITableView, indexPath: IndexPath, node: CellNode) -> (UITableViewCell & ComponentRenderable).Type {
override func componentCellClass(tableView: UITableView, indexPath: IndexPath, node: CellNode) -> (UITableViewCell & ComponentRenderable).Type {
return SwipeTableViewCell.self
}

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source "https://rubygems.org"

gem 'cocoapods', '1.7.0.rc.2'
gem 'cocoapods', '1.7.5'
gem 'jazzy', '0.9.4'
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ GEM
tzinfo (~> 1.1)
atomos (0.1.3)
claide (1.0.2)
cocoapods (1.7.0.rc.2)
cocoapods (1.7.5)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.7.0.rc.2)
cocoapods-core (= 1.7.5)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
Expand All @@ -22,13 +22,13 @@ GEM
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.2.0, < 3.0)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.8.2, < 2.0)
cocoapods-core (1.7.0.rc.2)
xcodeproj (>= 1.10.0, < 2.0)
cocoapods-core (1.7.5)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
Expand All @@ -45,8 +45,8 @@ GEM
colored2 (3.1.2)
concurrent-ruby (1.1.5)
escape (0.0.4)
ffi (1.10.0)
fourflusher (2.2.0)
ffi (1.11.1)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
i18n (0.9.5)
Expand All @@ -72,7 +72,7 @@ GEM
rb-inotify (0.10.0)
ffi (~> 1.0)
redcarpet (3.4.0)
rouge (3.3.0)
rouge (3.6.0)
ruby-macho (1.4.0)
sass (3.7.4)
sass-listen (~> 4.0.0)
Expand All @@ -85,7 +85,7 @@ GEM
thread_safe (~> 0.1)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.9.0)
xcodeproj (1.11.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -96,7 +96,7 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.7.0.rc.2)
cocoapods (= 1.7.5)
jazzy (= 0.9.4)

BUNDLED WITH
Expand Down
22 changes: 0 additions & 22 deletions Sources/APIAvailability.swift

This file was deleted.

Loading

0 comments on commit b89cc54

Please sign in to comment.