Skip to content

Commit a3022eb

Browse files
committed
Fix an issue where the same identifier is used for different cell types
1 parent 3ac01fb commit a3022eb

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Source/Rows/NavigationRow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ open class NavigationRow<T: UITableViewCell>: NavigationRowCompatible, Equatable
143143
}
144144

145145

146-
private extension UITableViewCell.CellStyle {
146+
internal extension UITableViewCell.CellStyle {
147147

148148
var stringValue: String {
149149
switch self {

Source/Rows/OptionRow.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ open class OptionRow<T: UITableViewCell>: OptionRowCompatible, Equatable {
7979
/// The type of the table view cell to display the row.
8080
public let cellType: UITableViewCell.Type = T.self
8181

82-
/// The reuse identifier of the table view cell to display the row. The default value is **UITableViewCell**.
83-
public let cellReuseIdentifier: String = T.reuseIdentifier
82+
/// Returns the reuse identifier of the table view cell to display the row.
83+
public var cellReuseIdentifier: String {
84+
return T.reuseIdentifier + (detailText?.style.stringValue ?? "")
85+
}
8486

8587
/// Returns the table view cell style for the specified detail text.
8688
public var cellStyle: UITableViewCell.CellStyle {

Source/Rows/SwitchRow.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ open class SwitchRow<T: SwitchCell>: SwitchRowCompatible, Equatable {
7979
/// The type of the table view cell to display the row.
8080
public let cellType: UITableViewCell.Type = T.self
8181

82-
/// The reuse identifier of the table view cell to display the row. The default value is **SwitchCell**.
83-
public let cellReuseIdentifier: String = T.reuseIdentifier
82+
/// Returns the reuse identifier of the table view cell to display the row.
83+
public var cellReuseIdentifier: String {
84+
return T.reuseIdentifier + (detailText?.style.stringValue ?? "")
85+
}
8486

8587
/// Returns the table view cell style for the specified detail text.
8688
public var cellStyle: UITableViewCell.CellStyle {

0 commit comments

Comments
 (0)