Skip to content

Commit f3e351b

Browse files
committed
Update the example with accessoryButtonAction
1 parent 7a1bd3d commit f3e351b

7 files changed

Lines changed: 21 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Rename `Row`'s title and subtitle to text and detail text to align with `UITableViewCell`'s naming
88
* `Subtitle` is deprecated and will be removed in **v2.0.0**
99
* Enable **detailText** in `OptionRow` and `SwitchRow`
10+
* Add **accessoryButtonAction** to `NavigationRow`
1011

1112
## v1.0.0
1213

Example-iOS/ViewControllers/DefaultViewController.swift renamed to Example-iOS/ViewControllers/ExampleViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// DefaultViewController.swift
2+
// ExampleViewController.swift
33
// Example-iOS
44
//
55
// Created by Ben on 01/09/2015.
@@ -27,7 +27,7 @@
2727
import UIKit
2828
import QuickTableViewController
2929

30-
internal final class DefaultViewController: QuickTableViewController {
30+
internal final class ExampleViewController: QuickTableViewController {
3131

3232
// MARK: - Properties
3333

@@ -55,7 +55,7 @@ internal final class DefaultViewController: QuickTableViewController {
5555

5656
Section(title: "Navigation", rows: [
5757
NavigationRow(text: "CellStyle.default", detailText: .none, icon: .image(gear)),
58-
NavigationRow(text: "CellStyle", detailText: .subtitle(".subtitle"), icon: .image(globe)),
58+
NavigationRow(text: "CellStyle", detailText: .subtitle(".subtitle"), icon: .image(globe), accessoryButtonAction: showDetail()),
5959
NavigationRow(text: "CellStyle", detailText: .value1(".value1"), icon: .image(time), action: showDetail()),
6060
NavigationRow(text: "CellStyle", detailText: .value2(".value2"))
6161
], footer: "UITableViewCellStyle.Value2 hides the image view."),

Example-iOS/ViewControllers/RootViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ internal final class RootViewController: QuickTableViewController {
4141
tableContents = [
4242
Section(title: "Default", rows: [
4343
NavigationRow(text: "Use default cell types", detailText: .none, action: { [weak self] _ in
44-
self?.navigationController?.pushViewController(DefaultViewController(), animated: true)
44+
self?.navigationController?.pushViewController(ExampleViewController(), animated: true)
4545
})
4646
]),
4747

Example-iOSUITests/ExampleUITests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ internal final class ExampleUITests: XCTestCase {
6868
return false
6969
}
7070

71+
tables.cells.containing(.staticText, identifier: ".subtitle").buttons["More Info"].tap()
72+
app.navigationBars.buttons.element(boundBy: 0).tap()
73+
expectation(for: existance, evaluatedWith: tables.staticTexts["CellStyle.subtitle is selected"], handler: nil)
74+
waitForExpectations(timeout: 5, handler: nil)
75+
7176
tables.staticTexts[".value1"].tap()
7277
app.navigationBars.buttons.element(boundBy: 0).tap()
7378
expectation(for: existance, evaluatedWith: tables.staticTexts["CellStyle.value1 is selected"], handler: nil)

Example-tvOS/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal final class AppDelegate: UIResponder, UIApplicationDelegate {
3333

3434
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
3535
window = UIWindow(frame: UIScreen.main.bounds)
36-
window?.rootViewController = UINavigationController(rootViewController: TableViewController())
36+
window?.rootViewController = UINavigationController(rootViewController: ExampleViewController())
3737
window?.makeKeyAndVisible()
3838
return true
3939
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// TableViewController.swift
2+
// ExampleViewController.swift
33
// Example-tvOS
44
//
55
// Created by Ben on 19/04/2018.
@@ -27,7 +27,7 @@
2727
import UIKit
2828
import QuickTableViewController
2929

30-
internal final class TableViewController: QuickTableViewController {
30+
internal final class ExampleViewController: QuickTableViewController {
3131

3232
override func viewDidLoad() {
3333
super.viewDidLoad()

QuickTableViewController.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
A7A26A71AB271F9D402D1A12 /* Pods_Example_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF3454E57819285B32968564 /* Pods_Example_iOS.framework */; };
2323
B50E73851F2E1BC900481910 /* RowStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50E73841F2E1BC900481910 /* RowStyle.swift */; };
2424
B51F21A51F417037009BC2C9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F21A41F417037009BC2C9 /* AppDelegate.swift */; };
25-
B51F21A71F417037009BC2C9 /* DefaultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F21A61F417037009BC2C9 /* DefaultViewController.swift */; };
25+
B51F21A71F417037009BC2C9 /* ExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F21A61F417037009BC2C9 /* ExampleViewController.swift */; };
2626
B51F21AC1F417037009BC2C9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B51F21AB1F417037009BC2C9 /* Assets.xcassets */; };
2727
B51F21B61F41709B009BC2C9 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B51F21B41F41709B009BC2C9 /* LaunchScreen.xib */; };
2828
B51F21C31F41E600009BC2C9 /* ExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F21C21F41E600009BC2C9 /* ExampleUITests.swift */; };
@@ -54,7 +54,7 @@
5454
B54A244D208883A300EEBA26 /* TapActionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B595627A1B9758BC00D6DAB1 /* TapActionCell.swift */; };
5555
B54A244E208883A300EEBA26 /* QuickTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */; };
5656
B54A24562088D44A00EEBA26 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54A24552088D44A00EEBA26 /* AppDelegate.swift */; };
57-
B54A24582088D44A00EEBA26 /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54A24572088D44A00EEBA26 /* TableViewController.swift */; };
57+
B54A24582088D44A00EEBA26 /* ExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54A24572088D44A00EEBA26 /* ExampleViewController.swift */; };
5858
B54A245D2088D44D00EEBA26 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B54A245C2088D44D00EEBA26 /* Assets.xcassets */; };
5959
B55475751F2DC3C00027F7C1 /* Configurable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B55475741F2DC3C00027F7C1 /* Configurable.swift */; };
6060
B578B5091C5673240021F7C3 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B578B5071C5673240021F7C3 /* icon.png */; };
@@ -193,7 +193,7 @@
193193
B50E73841F2E1BC900481910 /* RowStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowStyle.swift; sourceTree = "<group>"; };
194194
B51F21A21F417037009BC2C9 /* Example-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
195195
B51F21A41F417037009BC2C9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
196-
B51F21A61F417037009BC2C9 /* DefaultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultViewController.swift; sourceTree = "<group>"; };
196+
B51F21A61F417037009BC2C9 /* ExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleViewController.swift; sourceTree = "<group>"; };
197197
B51F21AB1F417037009BC2C9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
198198
B51F21B01F417037009BC2C9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
199199
B51F21B51F41709B009BC2C9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
@@ -218,7 +218,7 @@
218218
B54A24352088816E00EEBA26 /* Info-tvOSTests.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-tvOSTests.plist"; sourceTree = "<group>"; };
219219
B54A24532088D44A00EEBA26 /* Example-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
220220
B54A24552088D44A00EEBA26 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
221-
B54A24572088D44A00EEBA26 /* TableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = "<group>"; };
221+
B54A24572088D44A00EEBA26 /* ExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleViewController.swift; sourceTree = "<group>"; };
222222
B54A245C2088D44D00EEBA26 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
223223
B54A245E2088D44D00EEBA26 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
224224
B55475741F2DC3C00027F7C1 /* Configurable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configurable.swift; sourceTree = "<group>"; };
@@ -527,8 +527,8 @@
527527
children = (
528528
B54A24552088D44A00EEBA26 /* AppDelegate.swift */,
529529
B54A245C2088D44D00EEBA26 /* Assets.xcassets */,
530+
B54A24572088D44A00EEBA26 /* ExampleViewController.swift */,
530531
B54A245E2088D44D00EEBA26 /* Info.plist */,
531-
B54A24572088D44A00EEBA26 /* TableViewController.swift */,
532532
);
533533
path = "Example-tvOS";
534534
sourceTree = "<group>";
@@ -571,7 +571,7 @@
571571
children = (
572572
B5A37EAD20208EF7009C075F /* AppearanceViewController.swift */,
573573
B5A67A1120205F5C0075E0C8 /* CustomizationViewController.swift */,
574-
B51F21A61F417037009BC2C9 /* DefaultViewController.swift */,
574+
B51F21A61F417037009BC2C9 /* ExampleViewController.swift */,
575575
B5A67A13202069440075E0C8 /* RootViewController.swift */,
576576
);
577577
path = ViewControllers;
@@ -1106,7 +1106,7 @@
11061106
B51F21A51F417037009BC2C9 /* AppDelegate.swift in Sources */,
11071107
B5A37EAE20208EF7009C075F /* AppearanceViewController.swift in Sources */,
11081108
B5A67A1220205F5C0075E0C8 /* CustomizationViewController.swift in Sources */,
1109-
B51F21A71F417037009BC2C9 /* DefaultViewController.swift in Sources */,
1109+
B51F21A71F417037009BC2C9 /* ExampleViewController.swift in Sources */,
11101110
B5A67A14202069440075E0C8 /* RootViewController.swift in Sources */,
11111111
);
11121112
runOnlyForDeploymentPostprocessing = 0;
@@ -1218,7 +1218,7 @@
12181218
buildActionMask = 2147483647;
12191219
files = (
12201220
B54A24562088D44A00EEBA26 /* AppDelegate.swift in Sources */,
1221-
B54A24582088D44A00EEBA26 /* TableViewController.swift in Sources */,
1221+
B54A24582088D44A00EEBA26 /* ExampleViewController.swift in Sources */,
12221222
);
12231223
runOnlyForDeploymentPostprocessing = 0;
12241224
};

0 commit comments

Comments
 (0)