SwitchRow
open class SwitchRow<T> : SwitchRowCompatible, Equatable where T : SwitchCell
A class that represents a row with a switch.
-
Initializes a
SwitchRowwith a title, a switch state and an action closure. The detail text, icon and the customization closure are optional.Declaration
Swift
public init( text: String, detailText: DetailText? = nil, switchValue: Bool, icon: Icon? = nil, customization: ((UITableViewCell, Row & RowStyle) -> Void)? = nil, action: ((Row) -> Void)? )
-
The state of the switch.
Declaration
Swift
public var switchValue: Bool { get set }
-
The text of the row.
Declaration
Swift
public let text: String -
The detail text of the row.
Declaration
Swift
public let detailText: DetailText? -
A closure that will be invoked when the
switchValueis changed.Declaration
Swift
public let action: ((Row) -> Void)?
-
The type of the table view cell to display the row.
Declaration
Swift
public let cellType: UITableViewCell.Type -
Returns the reuse identifier of the table view cell to display the row.
Declaration
Swift
public var cellReuseIdentifier: String { get } -
Returns the table view cell style for the specified detail text.
Declaration
Swift
public var cellStyle: UITableViewCell.CellStyle { get } -
The icon of the row.
Declaration
Swift
public let icon: Icon? -
The default accessory type is
.none.Declaration
Swift
public let accessoryType: UITableViewCell.AccessoryType -
The
SwitchRowshould not be selectable.Declaration
Swift
public let isSelectable: Bool -
Returns
.checkmarkwhen theswitchValueis on, otherwise returns.none. -
The
SwitchRowis selectable on tvOS. -
The additional customization during cell configuration.
-
Returns true iff
lhsandrhshave equal titles, detail texts, switch values, and icons.Declaration
Swift
public static func == (lhs: SwitchRow, rhs: SwitchRow) -> Bool
View on GitHub
SwitchRow Class Reference