OptionRow
open class OptionRow<T> : OptionRowCompatible, Equatable where T : UITableViewCell
A class that represents a row of selectable option.
-
Initializes an
OptionRow
with a text, a selection state and an action closure. The detail text, icon, and the customization closure are optional.Declaration
Swift
public init( text: String, detailText: DetailText? = nil, isSelected: Bool, icon: Icon? = nil, customization: ((UITableViewCell, Row & RowStyle) -> Void)? = nil, action: ((Row) -> Void)? )
-
The state of selection.
Declaration
Swift
public var isSelected: 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
isSelected
is 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?
-
Returns
.checkmark
when the row is selected, otherwise returns.none
.Declaration
Swift
public var accessoryType: UITableViewCell.AccessoryType { get }
-
OptionRow
is always selectable.Declaration
Swift
public let isSelectable: Bool
-
Additional customization during cell configuration.
-
Returns true iff
lhs
andrhs
have equal titles, detail texts, selection states, and icons.Declaration
Swift
public static func == (lhs: OptionRow, rhs: OptionRow) -> Bool