Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bcylin committed Jan 6, 2019
2 parents ac3ae8c + a98d05b commit 5cadedd
Show file tree
Hide file tree
Showing 63 changed files with 1,382 additions and 534 deletions.
2 changes: 1 addition & 1 deletion .hound.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
swift:
swiftlint:
enabled: true
config_file: .swiftlint.yml
2 changes: 1 addition & 1 deletion .jazzy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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: 1.0.0
module_version: 1.1.0
output: docs/output
theme: fullwidth
skip_undocumented: true
7 changes: 4 additions & 3 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ disabled_rules:
- force_cast
- function_body_length
- identifier_name
- line_length
- vertical_whitespace
opt_in_rules:
- closure_end_indentation
Expand Down Expand Up @@ -30,10 +31,10 @@ opt_in_rules:
included:
- "Example-iOS"
- "Example-iOSUITests"
- "QuickTableViewController-iOS"
- "QuickTableViewController-iOSTests"
- "Example-tvOS"
- "Example-tvOSUITests"
- "Source"
- "Tests"
excluded:
- Carthage
- Pods
line_length: 192
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
language: objective-c
osx_image: xcode9.3beta
matrix:
include:
- env: VERSION=latest
osx_image: xcode10.1
cache:
- bundler
- cocoapods
before_install:
- export LANG=en_US.UTF-8
- xcrun instruments -s devices
- open -b com.apple.iphonesimulator
- open -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
install:
- bundle install --without development --deployment --jobs=3 --retry=3
- bundle exec pod install
before_script:
- if [ -n "$DANGER_GITHUB_API_TOKEN" ]; then bundle exec danger; fi
script:
- set -o pipefail
- xcodebuild clean build -workspace QuickTableViewController.xcworkspace -scheme QuickTableViewController-iOS -sdk iphonesimulator SWIFT_VERSION=3.0 | bundle exec xcpretty -c
- bundle exec rake "test:ios[QuickTableViewController-iOS]"
- bundle exec rake "test:tvos[QuickTableViewController-tvOS]"
- bash <(curl -s https://codecov.io/bash) -cF ios -J "QuickTableViewController"
- bundle exec rake "test:ios[Example-iOS]"
- bundle exec rake "build:tvos[Example-tvOS]"
- bundle exec rake "test:tvos[Example-tvOS]"
- make -B carthage
- make -B docs
after_success:
- sh scripts/update-docs.sh
- sh scripts/push-docs.sh
notifications:
email: false
slack:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## v1.1.0

#### Enhancements

* Swift 4.2, [#20](https://github.com/bcylin/QuickTableViewController/pull/20) by [@getaaron](https://github.com/getaaron) and [#28](https://github.com/bcylin/QuickTableViewController/pull/28) by [@ mttcrsp](https://github.com/mttcrsp)
* tvOS UI tests, [#27](https://github.com/bcylin/QuickTableViewController/pull/27) by [@FraDeliro](https://github.com/FraDeliro)
* `Subtitle` is deprecated and will be removed in [**v2.0.0**](https://github.com/bcylin/QuickTableViewController/releases/tag/v2.0.0)
* Rename `Row`'s title and subtitle to text and detail text to align with `UITableViewCell`'s naming
* Enable **detailText** in `OptionRow` and `SwitchRow`
* Add **accessoryButtonAction** to `NavigationRow`

## v1.0.0

#### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion Example-iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal final class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {

if #available(iOS 9.0, *) {
// See AppearanceViewController for the setups.
Expand Down
2 changes: 1 addition & 1 deletion Example-iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.1.0</string>
<key>CFBundleVersion</key>
<string>101</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
8 changes: 4 additions & 4 deletions Example-iOS/ViewControllers/AppearanceViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ internal final class AppearanceViewController: QuickTableViewController {

tableContents = [
Section(title: "Switch", rows: [
SwitchRow(title: "SwitchCell", switchValue: true, action: { _ in })
SwitchRow(text: "SwitchCell", switchValue: true, action: { _ in })
]),

Section(title: "Tap Action", rows: [
TapActionRow(title: "TapActionCell", action: { _ in })
TapActionRow(text: "TapActionCell", action: { _ in })
]),

Section(title: "Navigation", rows: [
NavigationRow(title: "UITableViewCell", subtitle: .belowTitle(".subtitle"), action: { _ in })
NavigationRow(text: "UITableViewCell", detailText: .subtitle(".subtitle"), action: { _ in })
]),

RadioSection(title: "Radio Buttons", options: [
OptionRow(title: "UITableViewCell", isSelected: true, action: { _ in })
OptionRow(text: "UITableViewCell", isSelected: true, action: { _ in })
])
]
}
Expand Down
36 changes: 18 additions & 18 deletions Example-iOS/ViewControllers/CustomizationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal final class CustomizationViewController: QuickTableViewController {

private let debugging = Section(
title: nil,
rows: [NavigationRow(title: "", subtitle: .none)],
rows: [NavigationRow(text: "", detailText: .none)],
footer: "Select or toggle each row to show their cell reuse identifiers."
)

Expand All @@ -56,13 +56,13 @@ internal final class CustomizationViewController: QuickTableViewController {

Section(title: "Switch", rows: [
SwitchRow<CustomSwitchCell>(
title: "SwitchRow\n<CustomSwitchCell>",
text: "SwitchRow\n<CustomSwitchCell>",
switchValue: true,
customization: set(label: "0-0"),
action: showLog()
),
CustomSwitchRow<SwitchCell>(
title: "CustomSwitchRow\n<SwitchCell>",
text: "CustomSwitchRow\n<SwitchCell>",
switchValue: false,
customization: set(label: "0-1"),
action: showLog()
Expand All @@ -71,67 +71,67 @@ internal final class CustomizationViewController: QuickTableViewController {

Section(title: "Tap Action", rows: [
TapActionRow<CustomTapActionCell>(
title: "TapActionRow\n<CustomTapActionCell>",
text: "TapActionRow\n<CustomTapActionCell>",
customization: set(label: "1-0"),
action: showLog()
),
CustomTapActionRow<TapActionCell>(
title: "CustomTapActionRow\n<TapActionCell>",
text: "CustomTapActionRow\n<TapActionCell>",
customization: set(label: "1-1"),
action: showLog()
)
]),

Section(title: "Navigation", rows: [
NavigationRow(
title: "NavigationRow",
subtitle: .none,
text: "NavigationRow",
detailText: .none,
customization: set(label: "2-0"),
action: showLog()
),
NavigationRow<CustomCell>(
title: "NavigationRow<CustomCell>",
subtitle: .belowTitle(".subtitle"),
text: "NavigationRow<CustomCell>",
detailText: .subtitle(".subtitle"),
customization: set(label: "2-1"),
action: showLog()
),
CustomNavigationRow(
title: "CustomNavigationRow",
subtitle: .rightAligned(".value1"),
text: "CustomNavigationRow",
detailText: .value1(".value1"),
customization: set(label: "2-2"),
action: showLog()
),
CustomNavigationRow<CustomCell>(
title: "CustomNavigationRow<CustomCell>",
subtitle: .leftAligned(".value2"),
text: "CustomNavigationRow<CustomCell>",
detailText: .value2(".value2"),
customization: set(label: "2-3"),
action: showLog()
)
]),

RadioSection(title: "Radio Buttons", options: [
OptionRow(
title: "OptionRow",
text: "OptionRow",
isSelected: false,
customization: set(label: "3-0"),
action: showLog()
),
CustomOptionRow(
title: "CustomOptionRow",
text: "CustomOptionRow",
isSelected: false,
customization: set(label: "3-1"),
action: showLog()
),
CustomOptionRow<CustomOptionCell>(
title: "CustomOptionRow<CustomOptionCell>",
text: "CustomOptionRow<CustomOptionCell>",
isSelected: false,
customization: set(label: "3-2"),
action: showLog()
)
]),

Section(title: nil, rows: [
NavigationRow(title: "Customization closure", subtitle: .none, customization: { cell, _ in
NavigationRow(text: "Customization closure", detailText: .none, customization: { cell, _ in
cell.accessibilityLabel = "4-0"
cell.accessoryView = UIImageView(image: #imageLiteral(resourceName: "iconmonstr-x-mark"))
})
Expand Down Expand Up @@ -162,7 +162,7 @@ internal final class CustomizationViewController: QuickTableViewController {
}
let identifier = ($0 as! RowStyle).cellReuseIdentifier
self?.debugging.rows = [
NavigationRow(title: identifier, subtitle: .none, customization: self?.set(label: "debug"))
NavigationRow(text: identifier, detailText: .none, customization: self?.set(label: "debug"))
]
print(identifier)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { [weak self] in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// DefaultViewController.swift
// ExampleViewController.swift
// Example-iOS
//
// Created by Ben on 01/09/2015.
Expand Down Expand Up @@ -27,11 +27,11 @@
import UIKit
import QuickTableViewController

internal final class DefaultViewController: QuickTableViewController {
internal final class ExampleViewController: QuickTableViewController {

// MARK: - Properties

private let debugging = Section(title: nil, rows: [NavigationRow(title: "", subtitle: .none)])
private let debugging = Section(title: nil, rows: [NavigationRow(text: "", detailText: .none)])

// MARK: - UIViewController

Expand All @@ -45,25 +45,25 @@ internal final class DefaultViewController: QuickTableViewController {

tableContents = [
Section(title: "Switch", rows: [
SwitchRow(title: "Setting 1", switchValue: true, icon: .image(globe), action: didToggleSwitch()),
SwitchRow(title: "Setting 2", switchValue: false, icon: .image(time), action: didToggleSwitch())
SwitchRow(text: "Setting 1", switchValue: true, icon: .image(globe), action: didToggleSwitch()),
SwitchRow(text: "Setting 2", switchValue: false, icon: .image(time), action: didToggleSwitch())
]),

Section(title: "Tap Action", rows: [
TapActionRow(title: "Tap action", action: showAlert())
TapActionRow(text: "Tap action", action: showAlert())
]),

Section(title: "Navigation", rows: [
NavigationRow(title: "CellStyle.default", subtitle: .none, icon: .image(gear)),
NavigationRow(title: "CellStyle", subtitle: .belowTitle(".subtitle"), icon: .image(globe)),
NavigationRow(title: "CellStyle", subtitle: .rightAligned(".value1"), icon: .image(time), action: showDetail()),
NavigationRow(title: "CellStyle", subtitle: .leftAligned(".value2"))
NavigationRow(text: "CellStyle.default", detailText: .none, icon: .image(gear)),
NavigationRow(text: "CellStyle", detailText: .subtitle(".subtitle"), icon: .image(globe), accessoryButtonAction: showDetail()),
NavigationRow(text: "CellStyle", detailText: .value1(".value1"), icon: .image(time), action: showDetail()),
NavigationRow(text: "CellStyle", detailText: .value2(".value2"))
], footer: "UITableViewCellStyle.Value2 hides the image view."),

RadioSection(title: "Radio Buttons", options: [
OptionRow(title: "Option 1", isSelected: true, action: didToggleSelection()),
OptionRow(title: "Option 2", isSelected: false, action: didToggleSelection()),
OptionRow(title: "Option 3", isSelected: false, action: didToggleSelection())
OptionRow(text: "Option 1", isSelected: true, action: didToggleSelection()),
OptionRow(text: "Option 2", isSelected: false, action: didToggleSelection()),
OptionRow(text: "Option 3", isSelected: false, action: didToggleSelection())
], footer: "See RadioSection for more details."),

debugging
Expand All @@ -83,7 +83,7 @@ internal final class DefaultViewController: QuickTableViewController {
private func didToggleSelection() -> (Row) -> Void {
return { [weak self] in
if let option = $0 as? OptionRowCompatible {
let state = "\(option.title) is " + (option.isSelected ? "selected" : "deselected")
let state = "\(option.text) is " + (option.isSelected ? "selected" : "deselected")
self?.showDebuggingText(state)
}
}
Expand All @@ -92,7 +92,7 @@ internal final class DefaultViewController: QuickTableViewController {
private func didToggleSwitch() -> (Row) -> Void {
return { [weak self] in
if let row = $0 as? SwitchRowCompatible {
let state = "\(row.title) = \(row.switchValue)"
let state = "\(row.text) = \(row.switchValue)"
self?.showDebuggingText(state)
}
}
Expand All @@ -110,7 +110,7 @@ internal final class DefaultViewController: QuickTableViewController {

private func showDetail() -> (Row) -> Void {
return { [weak self] in
let detail = $0.title + ($0.subtitle?.text ?? "")
let detail = $0.text + ($0.detailText?.text ?? "")
let controller = UIViewController()
controller.view.backgroundColor = .white
controller.title = detail
Expand All @@ -121,7 +121,7 @@ internal final class DefaultViewController: QuickTableViewController {

private func showDebuggingText(_ text: String) {
print(text)
debugging.rows = [NavigationRow(title: text, subtitle: .none)]
debugging.rows = [NavigationRow(text: text, detailText: .none)]
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { [weak self] in
self?.tableView.reloadData()
}
Expand Down
8 changes: 4 additions & 4 deletions Example-iOS/ViewControllers/RootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ internal final class RootViewController: QuickTableViewController {

tableContents = [
Section(title: "Default", rows: [
NavigationRow(title: "Use default cell types", subtitle: .none, action: { [weak self] _ in
self?.navigationController?.pushViewController(DefaultViewController(), animated: true)
NavigationRow(text: "Use default cell types", detailText: .none, action: { [weak self] _ in
self?.navigationController?.pushViewController(ExampleViewController(), animated: true)
})
]),

Section(title: "Customization", rows: [
NavigationRow(title: "Use custom cell types", subtitle: .none, action: { [weak self] _ in
NavigationRow(text: "Use custom cell types", detailText: .none, action: { [weak self] _ in
self?.navigationController?.pushViewController(CustomizationViewController(), animated: true)
})
]),

Section(title: "UIAppearance", rows: [
NavigationRow(title: "UILabel customization", subtitle: .none, action: { [weak self] _ in
NavigationRow(text: "UILabel customization", detailText: .none, action: { [weak self] _ in
self?.navigationController?.pushViewController(AppearanceViewController(), animated: true)
})
])
Expand Down
5 changes: 5 additions & 0 deletions Example-iOSUITests/ExampleUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ internal final class ExampleUITests: XCTestCase {
return false
}

tables.cells.containing(.staticText, identifier: ".subtitle").buttons["More Info"].tap()
app.navigationBars.buttons.element(boundBy: 0).tap()
expectation(for: existance, evaluatedWith: tables.staticTexts["CellStyle.subtitle is selected"], handler: nil)
waitForExpectations(timeout: 5, handler: nil)

tables.staticTexts[".value1"].tap()
app.navigationBars.buttons.element(boundBy: 0).tap()
expectation(for: existance, evaluatedWith: tables.staticTexts["CellStyle.value1 is selected"], handler: nil)
Expand Down
2 changes: 1 addition & 1 deletion Example-iOSUITests/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>1.0.0</string>
<string>1.1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
Loading

0 comments on commit 5cadedd

Please sign in to comment.