Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Example-iOS/ViewControllers/ExampleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ internal final class ExampleViewController: QuickTableViewController {

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

Expand Down
4 changes: 2 additions & 2 deletions Example-iOSUITests/ExampleUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ internal final class ExampleUITests: XCTestCase {
let tables = XCUIApplication().tables
let existance = NSPredicate(format: "exists == true")

tables.switches["Setting 1"].tap()
tables.switches.firstMatch.tap()
expectation(for: existance, evaluatedWith: tables.staticTexts["Setting 1 = false"], handler: nil)
waitForExpectations(timeout: 5, handler: nil)

tables.switches["Setting 1"].tap()
tables.switches.firstMatch.tap()
expectation(for: existance, evaluatedWith: tables.staticTexts["Setting 1 = true"], handler: nil)
waitForExpectations(timeout: 5, handler: nil)

Expand Down
6 changes: 4 additions & 2 deletions Source/Rows/SwitchRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ open class SwitchRow<T: SwitchCell>: SwitchRowCompatible, Equatable {
/// The reuse identifier of the table view cell to display the row. The default value is **SwitchCell**.
public let cellReuseIdentifier: String = T.reuseIdentifier

/// The cell style is `.default`.
public let cellStyle: UITableViewCell.CellStyle = .default
/// Returns the table view cell style for the specified detail text.
public var cellStyle: UITableViewCell.CellStyle {
return detailText?.style ?? .subtitle
}

/// The icon of the row.
public let icon: Icon?
Expand Down