Skip to content

Commit

Permalink
Merge branch 'hotfix/0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
bcylin committed Oct 8, 2016
2 parents 465b075 + b42d9f4 commit 629fce3
Show file tree
Hide file tree
Showing 21 changed files with 141 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .jazzy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ github_url: https://github.com/bcylin/QuickTableViewController
github_file_prefix: https://github.com/bcylin/QuickTableViewController/blob/develop
xcodebuild_arguments: [-project, QuickTableViewController.xcodeproj, -scheme, QuickTableViewController-iOS]
module: QuickTableViewController
module_version: 0.5.0
module_version: 0.5.1
output: docs/output
theme: fullwidth
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ install:
- bundle install --without development --deployment --jobs=3 --retry=3
- bundle exec pod install
before_script:
- bundle exec danger
- if [ -n "$DANGER_GITHUB_API_TOKEN" ]; then bundle exec danger; fi
script:
- bundle exec rake ci:build[Example]
- bundle exec scan --scheme QuickTableViewController-iOS
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# Change Log

## v0.5.1

#### Changes

* Specify table view cell reuse identifier on each type of row
* Update Swift syntax

## v0.5.0

#### Changes

* Swift 3.0

## v0.4.0
Expand Down
2 changes: 1 addition & 1 deletion Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.5.0</string>
<string>0.5.1</string>
<key>CFBundleVersion</key>
<string>101</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ViewController: QuickTableViewController {

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = super.tableView(tableView, cellForRowAt: indexPath)
if tableContents[(indexPath as NSIndexPath).section].title == nil {
if tableContents[indexPath.section].title == nil {
// Alter the cells created by QuickTableViewController
cell.imageView?.image = UIImage(named: "iconmonstr-x-mark")
}
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Nimble (5.0.0)
- Quick (0.10.0)
- QuickTableViewController (0.5.0)
- QuickTableViewController (0.5.1)

DEPENDENCIES:
- Nimble (from `https://github.com/Quick/Nimble.git`, tag `v5.0.0`)
Expand Down Expand Up @@ -29,7 +29,7 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
Nimble: 56fc9f5020effa2206de22c3dd910f4fb011b92f
Quick: 5d290df1c69d5ee2f0729956dcf0fd9a30447eaa
QuickTableViewController: ac1256ccbcad13349adbb1a4dcd4e9ecf548eb90
QuickTableViewController: 7f984b4af21e9f2fc7ef840e40a7f46a0198039a

PODFILE CHECKSUM: 700bf6791293c4cd4f5b58d4e2d1c0a00575e529

Expand Down
2 changes: 1 addition & 1 deletion QuickTableViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "QuickTableViewController"
s.version = "0.5.0"
s.version = "0.5.1"
s.summary = "A simple way to create a UITableView for settings."
s.screenshots = "https://bcylin.github.io/QuickTableViewController/img/screenshot.png"

Expand Down
14 changes: 5 additions & 9 deletions QuickTableViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
6FEC7AFD957FDD634E547C82 /* Pods_QuickTableViewControllerTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25C329622749AE5FEB731F1A /* Pods_QuickTableViewControllerTests_iOS.framework */; };
B5334F191B8CC5BD00C64A6D /* QuickTableViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
B5334F261B8CC5BD00C64A6D /* QuickTableViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5334F251B8CC5BD00C64A6D /* QuickTableViewControllerTests.swift */; };
B5334F301B8CC6AA00C64A6D /* QuickTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */; };
B578B5091C5673240021F7C3 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B578B5071C5673240021F7C3 /* icon.png */; };
B578B50A1C5673240021F7C3 /* icon-highlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = B578B5081C5673240021F7C3 /* icon-highlighted.png */; };
Expand Down Expand Up @@ -38,11 +37,10 @@
25C329622749AE5FEB731F1A /* Pods_QuickTableViewControllerTests_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_QuickTableViewControllerTests_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
332BB2E7F8C766C8BC0D5B5B /* Pods-QuickTableViewControllerTests-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickTableViewControllerTests-iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-QuickTableViewControllerTests-iOS/Pods-QuickTableViewControllerTests-iOS.debug.xcconfig"; sourceTree = "<group>"; };
B5334F131B8CC5BD00C64A6D /* QuickTableViewController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = QuickTableViewController.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B5334F171B8CC5BD00C64A6D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Source/Info.plist; sourceTree = SOURCE_ROOT; };
B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = QuickTableViewController.h; path = Source/QuickTableViewController.h; sourceTree = SOURCE_ROOT; };
B5334F171B8CC5BD00C64A6D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = QuickTableViewController/Info.plist; sourceTree = SOURCE_ROOT; };
B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = QuickTableViewController.h; path = QuickTableViewController/QuickTableViewController.h; sourceTree = SOURCE_ROOT; };
B5334F1E1B8CC5BD00C64A6D /* QuickTableViewControllerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = QuickTableViewControllerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
B5334F241B8CC5BD00C64A6D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B5334F251B8CC5BD00C64A6D /* QuickTableViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickTableViewControllerTests.swift; sourceTree = "<group>"; };
B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QuickTableViewController.swift; path = Source/QuickTableViewController.swift; sourceTree = SOURCE_ROOT; };
B578B5071C5673240021F7C3 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
B578B5081C5673240021F7C3 /* icon-highlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-highlighted.png"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -112,7 +110,6 @@
B5334F161B8CC5BD00C64A6D /* Supporting Files */,
B5EC18221B95FD7F0015C665 /* QuickTableModel.swift */,
B595627A1B9758BC00D6DAB1 /* QuickTableViewCell.swift */,
B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */,
B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */,
);
path = QuickTableViewController;
Expand All @@ -122,6 +119,7 @@
isa = PBXGroup;
children = (
B5334F171B8CC5BD00C64A6D /* Info.plist */,
B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */,
);
name = "Supporting Files";
sourceTree = "<group>";
Expand All @@ -132,7 +130,6 @@
B5DB7D331C4BA0E8007B84D2 /* ModelSpecs */,
B5334F231B8CC5BD00C64A6D /* Supporting Files */,
B57FAA6C1C512D5B008FF7C7 /* QuickTableViewControllerSpec.swift */,
B5334F251B8CC5BD00C64A6D /* QuickTableViewControllerTests.swift */,
);
path = QuickTableViewControllerTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -366,7 +363,6 @@
B5DB7D271C4B7F74007B84D2 /* IconSpec.swift in Sources */,
B5DB7D2D1C4B8294007B84D2 /* NavigationRowSpec.swift in Sources */,
B57FAA6E1C513454008FF7C7 /* QuickTableViewControllerSpec.swift in Sources */,
B5334F261B8CC5BD00C64A6D /* QuickTableViewControllerTests.swift in Sources */,
B5DB7D351C4CBB74007B84D2 /* SectionSpec.swift in Sources */,
B5DB94351BE117EE00E2CEDE /* SubtitleSpec.swift in Sources */,
B5DB7D2F1C4B95D3007B84D2 /* SwitchRowSpec.swift in Sources */,
Expand Down Expand Up @@ -498,7 +494,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Source/Info.plist;
INFOPLIST_FILE = QuickTableViewController/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController;
Expand All @@ -518,7 +514,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Source/Info.plist;
INFOPLIST_FILE = QuickTableViewController/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController;
Expand Down
2 changes: 1 addition & 1 deletion Source/Info.plist → QuickTableViewController/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.5.0</string>
<string>0.5.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion QuickTableViewControllerTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.5.0</string>
<string>0.5.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
1 change: 1 addition & 0 deletions QuickTableViewControllerTests/NavigationRowSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class NavigationRowSpec: QuickSpec {
expect(row.title) == "title"
expect(row.subtitle) == subtitle
expect(row.icon) == icon
expect(row.cellReuseIdentifier) == subtitle.style
expect(row.action).notTo(beNil())

row.action?(row)
Expand Down
38 changes: 38 additions & 0 deletions QuickTableViewControllerTests/QuickTableViewControllerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,48 @@ import Nimble
import Quick
import QuickTableViewController

// swiftlint:disable type_body_length
class QuickTableViewControllerSpec: QuickSpec {

override func spec() {

// MARK: - Initializer

describe("init(style:)") {
it("should set up table view with style") {
expect(QuickTableViewController().tableView.style) == UITableViewStyle.grouped
expect(QuickTableViewController(style: .plain).tableView.style) == UITableViewStyle.plain
}
}

// MARK: - UIViewController

describe("lifecycle") {
var tableView: UITableView!

it("should set up table view") {
let controller = QuickTableViewController(style: .grouped)
let view = controller.view
tableView = controller.tableView

expect(view?.subviews).to(contain(tableView))
expect(tableView.dataSource as? QuickTableViewController) == controller
expect(tableView.delegate as? QuickTableViewController) == controller
}

it("should register table view cell classes") {
expect(tableView.dequeueReusableCell(withIdentifier: "SwitchCell")).to(beAnInstanceOf(SwitchCell.self))
expect(tableView.dequeueReusableCell(withIdentifier: "TapActionCell")).to(beAnInstanceOf(TapActionCell.self))
expect(tableView.dequeueReusableCell(withIdentifier: "UITableViewCell")).to(beAnInstanceOf(UITableViewCell.self))
}

it("should nullify the references after controller is gone") {
expect(tableView).notTo(beNil())
expect(tableView.dataSource).toEventually(beNil())
expect(tableView.delegate).toEventually(beNil())
}
}

// MARK: - UITableViewDataSource

describe("numberOfSectionsInTableView(_:)") {
Expand Down
54 changes: 0 additions & 54 deletions QuickTableViewControllerTests/QuickTableViewControllerTests.swift

This file was deleted.

1 change: 1 addition & 0 deletions QuickTableViewControllerTests/SwitchRowSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class SwitchRowSpec: QuickSpec {
it("should initialize with given parameters") {
expect(row.title) == "title"
expect(row.switchValue) == true
expect(row.cellReuseIdentifier) == "SwitchCell"
expect(row.action).notTo(beNil())

row.action?(row)
Expand Down
1 change: 1 addition & 0 deletions QuickTableViewControllerTests/TapActionRowSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class TapActionRowSpec: QuickSpec {

it("should initialize with given parameters") {
expect(row.title) == "title"
expect(row.cellReuseIdentifier) == "TapActionCell"
expect(row.action).notTo(beNil())

row.action?(row)
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ SwitchRow(title: "Switch", switchValue: true, action: { (sender: Row) in }),
TapActionRow(title: "Tap action", action: { (sender: Row) in })
```

### Use Custom Cell Classes

```swift
// NavigationRow
tableView.register(CustomCell.self, forCellReuseIdentifier: "Subtitle.None")
tableView.register(CustomSubtitleCell.self, forCellReuseIdentifier: "Subtitle.BelowTitle")
tableView.register(CustomValue1StyleCell.self, forCellReuseIdentifier: "Subtitle.RightAligned")
tableView.register(CustomValue2StyleCell.self, forCellReuseIdentifier: "Subtitle.LeftAligned")

// SwitchRow
tableView.register(CustomSwitchCell.self, forCellReuseIdentifier: "SwitchCell")

// TapActionRow
tableView.register(CustomTapActionCell.self, forCellReuseIdentifier: "TapActionCell")
```

### Full Documentation

<https://bcylin.github.io/QuickTableViewController>
Expand Down
Loading

0 comments on commit 629fce3

Please sign in to comment.