diff --git a/Jenga.podspec b/Jenga.podspec index 3d4aefa..8c94611 100644 --- a/Jenga.podspec +++ b/Jenga.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Jenga" -s.version = "1.1.8" +s.version = "1.1.9" s.summary = "像SwiftUI一样使用DSL代码搭建UITableView" s.homepage = "https://github.com/fanglinwei/Jenga" diff --git a/Sources/Jenga/Core/Cell/SpacerCell.swift b/Sources/Jenga/Core/Cell/SpacerCell.swift index ff7ae93..4392060 100644 --- a/Sources/Jenga/Core/Cell/SpacerCell.swift +++ b/Sources/Jenga/Core/Cell/SpacerCell.swift @@ -1,5 +1,9 @@ import UIKit -open class SpacerCell: UITableViewCell { - +open class SpacerCell: UITableViewCell, ConfigurableCell { + public typealias CellData = UIColor + open func configure(with data: CellData) { + contentView.backgroundColor = data + backgroundColor = data + } } diff --git a/Sources/Jenga/Core/Row/SpacerRow.swift b/Sources/Jenga/Core/Row/SpacerRow.swift index 6d1afd2..b4fd46d 100644 --- a/Sources/Jenga/Core/Row/SpacerRow.swift +++ b/Sources/Jenga/Core/Row/SpacerRow.swift @@ -1,7 +1,7 @@ import UIKit -public struct SpacerRow: Row { - +public struct SpacerRow: Row, RowConfigurable { + public var height: RowHeight? public let color: UIColor @@ -12,9 +12,9 @@ public struct SpacerRow: Row { public var action: RowAction? - public let cellType: UITableViewCell.Type = T.self + public let cellType: UITableViewCell.Type = Cell.self - public var reuseIdentifier: String { T.reuseIdentifier } + public var reuseIdentifier: String { Cell.reuseIdentifier } public var selectionStyle: UITableViewCell.SelectionStyle = .none @@ -27,4 +27,12 @@ public struct SpacerRow: Row { self.color = color self.estimatedHeight = .constant(height) } + + public func configure(_ cell: UITableViewCell) { + (cell as? Cell)?.configure(with: color) + } + + public func recovery(_ cell: UITableViewCell) { + + } }