Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bcylin committed Jan 6, 2016
2 parents f0177fe + 844aea5 commit ad135a4
Show file tree
Hide file tree
Showing 24 changed files with 660 additions and 83 deletions.
17 changes: 17 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
disabled_rules:
- force_cast
included:
- Source
excluded:
- Carthage
- Pods
line_length: 128
type_body_length:
- 300 # warning
- 400 # error
function_body_length:
- 50 # warning
- 70 # error
variable_name_min_length:
- 3 # warning
- 2 # error
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: objective-c
osx_image: xcode7.2
before_install:
- if test -z $(brew list | grep -i xcproj); then brew install xcproj; fi
- if test -z $(brew list | grep -i carthage); then brew install carthage; fi
- export LANG=en_US.UTF-8
install:
- bundle install --without development --deployment --jobs=3 --retry=3
- bundle exec pod install
script:
- xctool -workspace QuickTableViewController.xcworkspace -scheme QuickTableViewController-iOS -sdk iphonesimulator clean test
- xctool -workspace QuickTableViewController.xcworkspace -scheme Example -sdk iphonesimulator clean build
notifications:
email: false
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Change Log

## v0.2.0

#### Added

* Support Swift 2
* `Row` and `Subtitle` now conform to `Equatable`
* Run tests on Travis CI
* Specify table view cell images with `Icon`, which includes highlighted image
* Separate self.view from self.tableView in QuickTableViewController

#### Fixed

* Fix the access control on the overridden initializer
* Clean up syntax with SwiftLint

## v0.1.1

#### Fixed
Expand Down
2 changes: 2 additions & 0 deletions Example/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
disabled_rules:
- line_length
23 changes: 21 additions & 2 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
57956990361B57E8E5ED5EFA /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F7EB7AD5BB1CC7B4C06D398 /* Pods_Example.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
57956990361B57E8E5ED5EFA /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F7EB7AD5BB1CC7B4C06D398 /* Pods_Example.framework */; };
B599253C1B95FA9100BE63A4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B599253B1B95FA9100BE63A4 /* AppDelegate.swift */; };
B599253E1B95FA9100BE63A4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B599253D1B95FA9100BE63A4 /* ViewController.swift */; };
B59925431B95FA9100BE63A4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B59925421B95FA9100BE63A4 /* Images.xcassets */; };
Expand Down Expand Up @@ -106,6 +106,7 @@
B59925341B95FA9100BE63A4 /* Resources */,
2EC7EBFA3F7708FBC74FB415 /* Embed Pods Frameworks */,
498881F5F0A8BC841CE52026 /* Copy Pods Resources */,
B5C89E7A1C20557600E15F3A /* Swift Lint */,
);
buildRules = (
);
Expand All @@ -122,7 +123,8 @@
B599252E1B95FA9100BE63A4 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0640;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = bcylin;
TargetAttributes = {
B59925351B95FA9100BE63A4 = {
Expand Down Expand Up @@ -191,6 +193,20 @@
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
B5C89E7A1C20557600E15F3A /* Swift Lint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Swift Lint";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"SwiftLint is not installed, run 'brew install swiftlint'\"\nfi";
};
DEB611CCBA993118C8348124 /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -253,6 +269,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -320,6 +337,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "me.neuvie.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -331,6 +349,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "me.neuvie.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
91 changes: 91 additions & 0 deletions Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B59925351B95FA9100BE63A4"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B59925351B95FA9100BE63A4"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B59925351B95FA9100BE63A4"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B59925351B95FA9100BE63A4"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
4 changes: 2 additions & 2 deletions Example/Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>me.neuvie.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.1</string>
<string>0.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
33 changes: 25 additions & 8 deletions Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
//

import UIKit
import MaterialDesignSymbol
import QuickTableViewController

class ViewController: QuickTableViewController {
Expand All @@ -35,6 +36,10 @@ class ViewController: QuickTableViewController {
super.viewDidLoad()
title = "QuickTableViewController"

let exit = MaterialDesignSymbol(text: MaterialDesignIcon.exitToApp48px, size:24).imageWithSize(CGSize(width: 24, height: 24))
let language = MaterialDesignSymbol(text: MaterialDesignIcon.language48px, size:24).imageWithSize(CGSize(width: 24, height: 24))
let timeMachine = MaterialDesignSymbol(text: MaterialDesignIcon.history48px, size:24).imageWithSize(CGSize(width: 24, height: 24))

tableContents = [
Section(title: "Switch", rows: [
SwitchRow(title: "Setting 1", switchValue: true, action: printValue),
Expand All @@ -45,25 +50,37 @@ class ViewController: QuickTableViewController {
TapActionRow(title: "Tap action", action: showAlert)
]),

Section(title: "Cell Styles", rows: [
NavigationRow(title: "CellStyle.Default", subtitle: .None, icon: Icon(image: exit) ),
NavigationRow(title: "CellStyle", subtitle: .BelowTitle(".Subtitle"), icon: Icon(image: language)),
NavigationRow(title: "CellStyle", subtitle: .RightAligned(".Value1"), icon: Icon(image: timeMachine), action: showDetail),
NavigationRow(title: "CellStyle", subtitle: .LeftAligned(".Value2"))
]),

Section(title: "Navigation", rows: [
NavigationRow(title: "Navigation", subtitle: .None, action: showDetail),
NavigationRow(title: "Navigation", subtitle: .BelowTitle("with subtitle"), action: showDetail),
NavigationRow(title: "Navigation", subtitle: .RightAligned("with detail text"), action: showDetail)
], footer: "UITableViewCellStyle.Value2 is not listed."),

Section(title: "Cell Styles", rows: [
NavigationRow(title: "CellStyle.Default", subtitle: .None),
NavigationRow(title: "CellStyle", subtitle: .BelowTitle(".Subtitle")),
NavigationRow(title: "CellStyle", subtitle: .RightAligned(".Value1")),
NavigationRow(title: "CellStyle", subtitle: .LeftAligned(".Value2"))
], footer: "NavigationRows without action."),

Section(title: nil, rows: [
NavigationRow(title: "Empty section title", subtitle: .None)
])
]
}

// MARK: - UITableViewDataSource

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = super.tableView(tableView, cellForRowAtIndexPath: indexPath)
if tableContents[indexPath.section].title == nil {
// Alter the cells created by QuickTableViewController
let symbol = MaterialDesignSymbol(text: MaterialDesignIcon.highlightRemove48px, size:24)
cell.imageView?.image = symbol.imageWithSize(CGSize(width: 24, height: 24))
}
return cell
}

// MARK: - Private Methods

private func showAlert(sender: Row) {
Expand All @@ -83,7 +100,7 @@ class ViewController: QuickTableViewController {

private func printValue(sender: Row) {
if let row = sender as? SwitchRow {
println("\(row.title) = \(row.switchValue)")
print("\(row.title) = \(row.switchValue)")
}
}

Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "http://rubygems.org"

gem "cocoapods", "~> 0.39.0"
63 changes: 63 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
GEM
remote: http://rubygems.org/
specs:
activesupport (4.2.5)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
claide (0.9.1)
cocoapods (0.39.0)
activesupport (>= 4.0.2)
claide (~> 0.9.1)
cocoapods-core (= 0.39.0)
cocoapods-downloader (~> 0.9.3)
cocoapods-plugins (~> 0.4.2)
cocoapods-search (~> 0.1.0)
cocoapods-stats (~> 0.6.2)
cocoapods-trunk (~> 0.6.4)
cocoapods-try (~> 0.5.1)
colored (~> 1.2)
escape (~> 0.0.4)
molinillo (~> 0.4.0)
nap (~> 1.0)
xcodeproj (~> 0.28.2)
cocoapods-core (0.39.0)
activesupport (>= 4.0.2)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-downloader (0.9.3)
cocoapods-plugins (0.4.2)
nap
cocoapods-search (0.1.0)
cocoapods-stats (0.6.2)
cocoapods-trunk (0.6.4)
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
cocoapods-try (0.5.1)
colored (1.2)
escape (0.0.4)
fuzzy_match (2.0.4)
i18n (0.7.0)
json (1.8.3)
minitest (5.8.3)
molinillo (0.4.1)
nap (1.0.0)
netrc (0.7.8)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
xcodeproj (0.28.2)
activesupport (>= 3)
claide (~> 0.9.1)
colored (~> 1.2)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 0.39.0)

BUNDLED WITH
1.11.2
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ xcodeproj "Example/Example"

target :Example do
pod "QuickTableViewController", path: "./"
pod "MaterialDesignSymbol"
end
Loading

0 comments on commit ad135a4

Please sign in to comment.