@@ -31,24 +31,7 @@ public enum SPDiffableTableCellProviders {
31
31
For change style of cells requerid register new cell provider.
32
32
*/
33
33
public static var `default` : [ SPDiffableTableCellProvider ] {
34
- return [ rowDetail, rowSubtitle, self . switch, stepper]
35
- }
36
-
37
- public static var customCell : SPDiffableTableCellProvider {
38
- let cellProvider : SPDiffableTableCellProvider = { ( tableView, indexPath, item) -> UITableViewCell ? in
39
- guard let item = item as? SPDiffableCustomTableRow else { return nil }
40
- let cell = tableView. dequeueReusableCell ( withIdentifier: SPDiffableCustomTableViewCell . reuseIdentifier, for: indexPath) as! SPDiffableCustomTableViewCell
41
- cell. textLabel? . text = item. text
42
- cell. textLabel? . textColor = item. textColor
43
- cell. textLabel? . font = item. textFont
44
- cell. detailTextLabel? . text = item. detail
45
- cell. imageView? . image = item. icon
46
- cell. accessoryType = item. accessoryType
47
- cell. selectionStyle = item. selectionStyle
48
- cell. higlightStyle = item. higlightStyle
49
- return cell
50
- }
51
- return cellProvider
34
+ return [ rowDetail, rowSubtitle, `switch`, stepper, customisable]
52
35
}
53
36
54
37
public static var rowDetail : SPDiffableTableCellProvider {
@@ -111,4 +94,21 @@ public enum SPDiffableTableCellProviders {
111
94
}
112
95
return cellProvider
113
96
}
97
+
98
+ public static var customisable : SPDiffableTableCellProvider {
99
+ let cellProvider : SPDiffableTableCellProvider = { ( tableView, indexPath, item) -> UITableViewCell ? in
100
+ guard let item = item as? SPDiffableCustomTableRow else { return nil }
101
+ let cell = tableView. dequeueReusableCell ( withIdentifier: SPDiffableCustomTableViewCell . reuseIdentifier, for: indexPath) as! SPDiffableCustomTableViewCell
102
+ cell. textLabel? . text = item. text
103
+ cell. textLabel? . textColor = item. textColor
104
+ cell. textLabel? . font = item. textFont
105
+ cell. detailTextLabel? . text = item. detail
106
+ cell. imageView? . image = item. icon
107
+ cell. accessoryType = item. accessoryType
108
+ cell. selectionStyle = item. selectionStyle
109
+ cell. higlightStyle = item. higlightStyle
110
+ return cell
111
+ }
112
+ return cellProvider
113
+ }
114
114
}
0 commit comments