Skip to content

Commit

Permalink
Merge pull request #21 from ra1028/custom-cell-class
Browse files Browse the repository at this point in the history
Custom cell class
  • Loading branch information
ra1028 committed Jul 29, 2019
2 parents 1aa1389 + 4871ee5 commit c3ead29
Show file tree
Hide file tree
Showing 104 changed files with 3,036 additions and 4,587 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -24,7 +24,10 @@ docs/undocumented.json

## Gems
.bundle
vendor/bundle
vendor

## Carthage
Carthage/Build

## CocoaPods
Pods/
8 changes: 7 additions & 1 deletion .hound.yml
@@ -1,2 +1,8 @@
swiftlint:
config_file: .swiftlint.yml
config_file: .swiftlint.yml

ruby:
enabled: false

javascript:
enabled: false
9 changes: 2 additions & 7 deletions .jazzy.yml
Expand Up @@ -44,17 +44,12 @@ custom_categories:
- UICollectionViewReloadDataUpdater
- name: Interfaces
children:
- ComponentRenderable
- UITableViewComponentCell
- UITableViewComponentHeaderFooterView
- UICollectionViewComponentCell
- UICollectionComponentReusableView
- name: Content Protocols
children:
- UITableViewCellContent
- UITableViewHeaderFooterViewContent
- UICollectionViewCellContent
- UICollectionReusableViewContent
- name: Changesets
children:
- DataChangeset
- StagedDataChangeset
- StagedDataChangeset
4 changes: 3 additions & 1 deletion .swiftlint.yml
Expand Up @@ -2,6 +2,8 @@

excluded:
- Carthage
- Pods
- Examples/Example-iOS/Pods

disabled_rules:
- type_name
Expand Down Expand Up @@ -29,4 +31,4 @@ cyclomatic_complexity:
warning: 12

statement_position:
statement_mode: uncuddled_else
statement_mode: uncuddled_else
74 changes: 29 additions & 45 deletions Carbon.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

99 changes: 64 additions & 35 deletions Examples/Example-iOS/Example-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Examples/Example-iOS/Gemfile
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem 'cocoapods', '1.7.5'
76 changes: 76 additions & 0 deletions Examples/Example-iOS/Gemfile.lock
@@ -0,0 +1,76 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
atomos (0.1.3)
claide (1.0.2)
cocoapods (1.7.5)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
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)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.3.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.10.0, < 2.0)
cocoapods-core (1.7.5)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored2 (3.1.2)
concurrent-ruby (1.1.5)
escape (0.0.4)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
minitest (5.11.3)
molinillo (0.6.6)
nanaimo (0.2.6)
nap (1.1.0)
netrc (0.11.0)
ruby-macho (1.4.0)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
xcodeproj (1.11.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.6)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.7.5)

BUNDLED WITH
2.0.1
5 changes: 5 additions & 0 deletions Examples/Example-iOS/Makefile
@@ -0,0 +1,5 @@
pods-install:
bundle exec pod install || bundle exec pod install --repo-update

gems-install:
bundle check || bundle install --path vendor/bundle --clean --jobs=4
13 changes: 13 additions & 0 deletions Examples/Example-iOS/Podfile
@@ -0,0 +1,13 @@
source 'https://cdn.cocoapods.org/'
platform :ios, '12.2'

use_frameworks!
inhibit_all_warnings!

ENV['COCOAPODS_DISABLE_STATS'] = 'true'

target 'Example-iOS' do
pod 'Carbon', path: '../../'
pod 'MagazineLayout', '1.5.0'
pod 'SwipeCellKit', '2.6.0'
end
31 changes: 31 additions & 0 deletions Examples/Example-iOS/Podfile.lock
@@ -0,0 +1,31 @@
PODS:
- Carbon (0.3.0):
- DifferenceKit/Core (~> 1.1)
- DifferenceKit/Core (1.1.3)
- MagazineLayout (1.5.0)
- SwipeCellKit (2.6.0)

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

SPEC REPOS:
https://cdn.cocoapods.org/:
- DifferenceKit
- MagazineLayout
- SwipeCellKit

EXTERNAL SOURCES:
Carbon:
:path: "../../"

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

PODFILE CHECKSUM: be830e3243aec6afdc78b16a82166efd1db3cb52

COCOAPODS: 1.7.5
7 changes: 7 additions & 0 deletions Examples/Example-iOS/README.md
@@ -0,0 +1,7 @@
# How to Run

1. Change directory from the root of repository `cd ./Examples/Example-iOS`
1. Install gems by Bundler `make gems-install`
1. Install dependencies by CocoaPods `make pods-install`
1. Open `Example-iOS.xcworkspace` on Xcode
1. Run `Example-iOS` scheme
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Trash.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Expand Up @@ -13,3 +13,15 @@ extension UIColor {
}
}
}

extension UITableView {
open override func touchesShouldCancel(in view: UIView) -> Bool {
return true
}
}

extension UINavigationController {
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return topViewController?.supportedInterfaceOrientations ?? .portrait
}
}

This file was deleted.

4 changes: 1 addition & 3 deletions Examples/Example-iOS/Sources/Kyoto/KyotoImage.swift
Expand Up @@ -15,9 +15,7 @@ struct KyotoImage: IdentifiableComponent, Hashable {
}

func referenceSize(in bounds: CGRect) -> CGSize? {
let shortSide = min(bounds.width, bounds.height)
let length = ceil(shortSide * 0.425)
return CGSize(width: length, height: length)
return nil
}
}

Expand Down
4 changes: 2 additions & 2 deletions Examples/Example-iOS/Sources/Kyoto/KyotoImageContent.xib
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example-iOS/Sources/Kyoto/KyotoTop.swift
Expand Up @@ -9,7 +9,7 @@ struct KyotoTop: Component, Equatable {
func render(in content: KyotoTopContent) {}

func referenceSize(in bounds: CGRect) -> CGSize? {
return CGSize(width: bounds.width, height: 452)
return nil
}
}

Expand Down
9 changes: 4 additions & 5 deletions Examples/Example-iOS/Sources/Kyoto/KyotoTopContent.xib
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -20,7 +20,6 @@
<rect key="frame" x="16" y="16" width="343" height="180"/>
<constraints>
<constraint firstAttribute="height" constant="180" id="I91-t3-dHj"/>
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="350" id="SCd-o7-4aA"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" verticalCompressionResistancePriority="749" text="Kinkaku-ji" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TYS-9J-0uy">
Expand All @@ -30,7 +29,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalCompressionResistancePriority="748" verticalCompressionResistancePriority="748" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="snO-9F-0eV">
<rect key="frame" x="16" y="267.5" width="343" height="168.5"/>
<rect key="frame" x="16" y="267.5" width="343" height="184.5"/>
<string key="text">Kinkaku-ji (金閣寺, literally "Temple of the Golden Pavilion"), officially named Rokuon-ji (鹿苑寺, literally "Deer Garden Temple"), is a Zen Buddhist temple in Kyoto, Japan.
It is one of the most popular buildings in Japan, attracting a large number of visitors annually.
It is designated as a National Special Historic Site, a National Special Landscape and is one of 17 locations making up the Historic Monuments of Ancient Kyoto which are World Heritage Sites.</string>
Expand All @@ -46,7 +45,7 @@ It is designated as a National Special Historic Site, a National Special Landsca
<constraint firstItem="O1i-dH-00B" firstAttribute="centerX" secondItem="MJs-we-ZTL" secondAttribute="centerX" id="M7s-z8-dCm"/>
<constraint firstItem="TYS-9J-0uy" firstAttribute="leading" secondItem="O1i-dH-00B" secondAttribute="leading" id="T8y-Cd-ouS"/>
<constraint firstItem="TYS-9J-0uy" firstAttribute="trailing" secondItem="O1i-dH-00B" secondAttribute="trailing" id="Tni-WE-Fu6"/>
<constraint firstAttribute="bottom" secondItem="snO-9F-0eV" secondAttribute="bottom" priority="750" constant="16" id="VeK-xV-YXM"/>
<constraint firstAttribute="bottom" secondItem="snO-9F-0eV" secondAttribute="bottom" id="VeK-xV-YXM"/>
<constraint firstItem="snO-9F-0eV" firstAttribute="leading" secondItem="O1i-dH-00B" secondAttribute="leading" id="Xtj-EB-215"/>
<constraint firstItem="O1i-dH-00B" firstAttribute="leading" secondItem="MJs-we-ZTL" secondAttribute="leading" priority="751" constant="16" id="f8a-NX-xu0"/>
<constraint firstItem="O1i-dH-00B" firstAttribute="top" secondItem="YCd-9D-qxO" secondAttribute="top" constant="16" id="j9a-Ke-YMI"/>
Expand Down

0 comments on commit c3ead29

Please sign in to comment.