@@ -31,24 +31,7 @@ public enum SPDiffableTableCellProviders {
3131 For change style of cells requerid register new cell provider.
3232 */
3333 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]
5235 }
5336
5437 public static var rowDetail : SPDiffableTableCellProvider {
@@ -111,4 +94,21 @@ public enum SPDiffableTableCellProviders {
11194 }
11295 return cellProvider
11396 }
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+ }
114114}
0 commit comments