Skip to content

Commit

Permalink
Merge branch 'release/0.5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
bcylin committed Apr 24, 2017
2 parents 9d9ef0c + 451b95a commit 15c3100
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 30 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.2
module_version: 0.5.3
output: docs/output
theme: fullwidth
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## v0.5.3

* Fix the cell reuse identifier of `SwitchRow` and `TapActionRow` to be compatible with `0.5.x`

Cell Reuse identifier | SwitchRow | TapActionRow
--------------------- | ------------------------------------ | ---------------------------------------
`<= 0.5.0` | `NSStringFromClass(SwitchRow.self)` | `NSStringFromClass(TapActionRow.self)`
`== 0.5.1` | `String(describing: SwitchRow.self)` | `String(describing: TapActionRow.self)`
`== 0.5.2` | `String(describing: SwitchRow.self)` | `String(describing: TapActionRow.self)`
`== 0.5.3` | `NSStringFromClass(SwitchRow.self)` | `NSStringFromClass(TapActionRow.self)`

## v0.5.2

#### Changes
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.2</string>
<string>0.5.3</string>
<key>CFBundleVersion</key>
<string>101</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
15 changes: 8 additions & 7 deletions Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import UIKit
import QuickTableViewController
import Weakify

class ViewController: QuickTableViewController {

Expand All @@ -41,25 +42,25 @@ class ViewController: QuickTableViewController {

tableContents = [
Section(title: "Switch", rows: [
SwitchRow(title: "Setting 1", switchValue: true, icon: Icon(image: globe), action: printValue),
SwitchRow(title: "Setting 2", switchValue: false, icon: Icon(image: time), action: printValue)
SwitchRow(title: "Setting 1", switchValue: true, icon: Icon(image: globe), action: weakify(self, type(of: self).printValue)),
SwitchRow(title: "Setting 2", switchValue: false, icon: Icon(image: time), action: weakify(self, type(of: self).printValue))
]),

Section(title: "Tap Action", rows: [
TapActionRow(title: "Tap action", action: showAlert)
TapActionRow(title: "Tap action", action: weakify(self, type(of: self).showAlert))
]),

Section(title: "Cell Styles", rows: [
NavigationRow(title: "CellStyle.Default", subtitle: .none, icon: Icon(image: gear)),
NavigationRow(title: "CellStyle", subtitle: .belowTitle(".Subtitle"), icon: Icon(image: globe)),
NavigationRow(title: "CellStyle", subtitle: .rightAligned(".Value1"), icon: Icon(image: time), action: showDetail),
NavigationRow(title: "CellStyle", subtitle: .rightAligned(".Value1"), icon: Icon(image: time), action: weakify(self, type(of: self).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)
NavigationRow(title: "Navigation", subtitle: .none, action: weakify(self, type(of: self).showDetail)),
NavigationRow(title: "Navigation", subtitle: .belowTitle("with subtitle"), action: weakify(self, type(of: self).showDetail)),
NavigationRow(title: "Navigation", subtitle: .rightAligned("with detail text"), action: weakify(self, type(of: self).showDetail))
], footer: "UITableViewCellStyle.Value2 is not listed."),

Section(title: nil, rows: [
Expand Down
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ end
target :Example do
project "Example"
pod "QuickTableViewController", path: "./"
pod "Weakify", git: "https://github.com/klundberg/Weakify.git", tag: "v0.4.0"
end
15 changes: 12 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
PODS:
- Nimble (6.1.0)
- Quick (1.1.0)
- QuickTableViewController (0.5.2)
- QuickTableViewController (0.5.3)
- Weakify (0.4.0)

DEPENDENCIES:
- Nimble (from `https://github.com/Quick/Nimble.git`, tag `v6.1.0`)
- Quick (from `https://github.com/Quick/Quick.git`, tag `v1.1.0`)
- QuickTableViewController (from `./`)
- Weakify (from `https://github.com/klundberg/Weakify.git`, tag `v0.4.0`)

EXTERNAL SOURCES:
Nimble:
Expand All @@ -17,6 +19,9 @@ EXTERNAL SOURCES:
:tag: v1.1.0
QuickTableViewController:
:path: "./"
Weakify:
:git: https://github.com/klundberg/Weakify.git
:tag: v0.4.0

CHECKOUT OPTIONS:
Nimble:
Expand All @@ -25,12 +30,16 @@ CHECKOUT OPTIONS:
Quick:
:git: https://github.com/Quick/Quick.git
:tag: v1.1.0
Weakify:
:git: https://github.com/klundberg/Weakify.git
:tag: v0.4.0

SPEC CHECKSUMS:
Nimble: 46fc2a2c3f2f5bb5e2d7e89756fb710c1457f27a
Quick: 4700beb8056662b579facd79eaca7f04fb3d48e6
QuickTableViewController: cbaacea5a467f2e1bf83d13a716c5bbd6bc9f6b2
QuickTableViewController: 245898ed807cd025e5fe6882402e5b9d54c6309f
Weakify: 77be86c462237baa373e97fcf57d4d8637c2e614

PODFILE CHECKSUM: a12ebb981507415ad7c19091d127cf3c2f6c6af0
PODFILE CHECKSUM: b520bcde1e1651aa7c27f37788849ebe65f1c362

COCOAPODS: 1.2.1
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.2"
s.version = "0.5.3"
s.summary = "A simple way to create a UITableView for settings."
s.screenshots = "https://bcylin.github.io/QuickTableViewController/img/screenshot.png"

Expand Down
2 changes: 1 addition & 1 deletion 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.2</string>
<string>0.5.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
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.2</string>
<string>0.5.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class QuickTableViewControllerSpec: QuickSpec {
}

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: "QuickTableViewController.SwitchCell")).to(beAnInstanceOf(SwitchCell.self))
expect(tableView.dequeueReusableCell(withIdentifier: "QuickTableViewController.TapActionCell")).to(beAnInstanceOf(TapActionCell.self))
expect(tableView.dequeueReusableCell(withIdentifier: "UITableViewCell")).to(beAnInstanceOf(UITableViewCell.self))
}

Expand Down
2 changes: 1 addition & 1 deletion QuickTableViewControllerTests/SwitchRowSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +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.cellReuseIdentifier) == "QuickTableViewController.SwitchCell"
expect(row.action).notTo(beNil())

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

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

row.action?(row)
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ class ViewController: QuickTableViewController {
]),

Section(title: "Tap Action", rows: [
TapActionRow(title: "Tap action", action: showAlert)
TapActionRow(title: "Tap action", action: { [weak self] in self?.showAlert($0) })
]),

Section(title: "Cell Styles", rows: [
NavigationRow(title: "CellStyle.Default", subtitle: .None, icon: Icon(image: UIImage(named: "exit"), highlightedImage: UIImage(named: "exit-highlighted"))),
NavigationRow(title: "CellStyle", subtitle: .BelowTitle(".Subtitle"), icon: Icon(image: UIImage(named: "language"))),
NavigationRow(title: "CellStyle", subtitle: .RightAligned(".Value1"), icon: Icon(imageName: "timeMachine"), action: showDetail),
NavigationRow(title: "CellStyle", subtitle: .RightAligned(".Value1"), icon: Icon(imageName: "timeMachine"), action: { [weak self] in self?.showDetail($0) }),
NavigationRow(title: "CellStyle", subtitle: .LeftAligned(".Value2"))
])
]
Expand Down Expand Up @@ -122,14 +122,18 @@ 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")
```

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

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

> Note: in `0.5.1` & `0.5.2`, **SwitchRow** and **TapActionRow** were using `String(describing: SwitchCell.self)` and `String(describing: TapActionCell.self)` as reuse identifiers. Fixed in `0.5.3` for backward compatibility.

### Full Documentation

<https://bcylin.github.io/QuickTableViewController>
Expand Down
2 changes: 1 addition & 1 deletion Source/NavigationRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct NavigationRow: Row, Equatable, IconEnabled {

/// Returns `subtitle.style` as the reuse identifier of the table view cell to display the row.
public var cellReuseIdentifier: String {
return subtitle?.style ?? String(describing: UITableViewCell.self)
return subtitle?.style ?? NSStringFromClass(UITableViewCell.self)
}

/// A closure related to the navigation when the row is selected.
Expand Down
8 changes: 4 additions & 4 deletions Source/QuickTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ open class QuickTableViewController: UIViewController,
tableView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
tableView.dataSource = self
tableView.delegate = self
tableView.register(SwitchCell.self, forCellReuseIdentifier: String(describing: SwitchCell.self))
tableView.register(TapActionCell.self, forCellReuseIdentifier: String(describing: TapActionCell.self))
tableView.register(UITableViewCell.self, forCellReuseIdentifier: String(describing: UITableViewCell.self))
tableView.register(SwitchCell.self, forCellReuseIdentifier: NSStringFromClass(SwitchCell.self))
tableView.register(TapActionCell.self, forCellReuseIdentifier: NSStringFromClass(TapActionCell.self))
tableView.register(UITableViewCell.self, forCellReuseIdentifier: NSStringFromClass(UITableViewCell.self))
}

open override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -148,7 +148,7 @@ open class QuickTableViewController: UIViewController,
}

cell?.textLabel?.text = row.title
return cell ?? tableView.dequeueReusableCell(withIdentifier: String(describing: UITableViewCell.self), for: indexPath)
return cell ?? tableView.dequeueReusableCell(withIdentifier: NSStringFromClass(UITableViewCell.self), for: indexPath)
}

open func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
Expand Down
2 changes: 1 addition & 1 deletion Source/SwitchRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public struct SwitchRow: Row, Equatable, IconEnabled {
}

/// The value is **SwitchCell**, as the reuse identifier of the table view cell to display the row.
public let cellReuseIdentifier: String = String(describing: SwitchCell.self)
public let cellReuseIdentifier: String = NSStringFromClass(SwitchCell.self)

/// A closure that will be invoked when the switchValue is changed.
public var action: ((Row) -> Void)?
Expand Down
2 changes: 1 addition & 1 deletion Source/TapActionRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public struct TapActionRow: Row, Equatable {
public let subtitle: Subtitle? = nil

/// The value is **TapActionCell**, as the reuse identifier of the table view cell to display the row.
public let cellReuseIdentifier: String = String(describing: TapActionCell.self)
public let cellReuseIdentifier: String = NSStringFromClass(TapActionCell.self)

/// A closure as the tap action when the row is selected.
public var action: ((Row) -> Void)?
Expand Down

0 comments on commit 15c3100

Please sign in to comment.