remove isPrototype

This commit is contained in:
Max Sokolov 2016-08-19 15:40:21 +03:00
parent 4b4d2a616d
commit 8477cea35b
8 changed files with 10 additions and 10 deletions

View File

@ -19,7 +19,7 @@ class AutolayoutTableViewCell: UITableViewCell, ConfigurableCell {
@IBOutlet var titleLabel: UILabel!
@IBOutlet var subtitleLabel: UILabel!
func configure(with string: T, isPrototype: Bool) {
func configure(with string: T) {
titleLabel.text = LoremIpsumTitle
subtitleLabel.text = LoremIpsumBody

View File

@ -11,7 +11,7 @@ import TableKit
class ConfigurableTableViewCell: UITableViewCell, ConfigurableCell {
func configure(with text: String, isPrototype: Bool) {
func configure(with text: String) {
accessoryType = .DisclosureIndicator
textLabel?.text = text

View File

@ -13,7 +13,7 @@ class NibTableViewCell: UITableViewCell, ConfigurableCell {
@IBOutlet weak var titleLabel: UILabel!
func configure(with number: Int, isPrototype: Bool) {
func configure(with number: Int) {
titleLabel.text = "\(number)"
}

View File

@ -32,7 +32,7 @@ public protocol ConfigurableCell: ReusableCell {
static func estimatedHeight() -> CGFloat?
static func defaultHeight() -> CGFloat?
func configure(with _: T, isPrototype: Bool)
func configure(with _: T)
}
public extension ReusableCell where Self: UITableViewCell {

View File

@ -53,7 +53,7 @@ public class PrototypeHeightStrategy: CellHeightCalculatable {
cell.bounds = CGRectMake(0, 0, tableView.bounds.size.width, cell.bounds.height)
row.configure(cell, isPrototype: true)
row.configure(cell)
cell.setNeedsLayout()
cell.layoutIfNeeded()

View File

@ -132,7 +132,7 @@ public class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate
cell.layoutIfNeeded()
}
row.configure(cell, isPrototype: false)
row.configure(cell)
invoke(action: .configure, cell: cell, indexPath: indexPath)
return cell

View File

@ -22,7 +22,7 @@ import UIKit
public protocol RowConfigurable {
func configure(cell: UITableViewCell, isPrototype: Bool)
func configure(cell: UITableViewCell)
}
public protocol RowActionable {
@ -78,8 +78,8 @@ public class TableRow<ItemType, CellType: ConfigurableCell where CellType.T == I
// MARK: - RowConfigurable -
public func configure(cell: UITableViewCell, isPrototype: Bool) {
(cell as? CellType)?.configure(with: item, isPrototype: isPrototype)
public func configure(cell: UITableViewCell) {
(cell as? CellType)?.configure(with: item)
}
// MARK: - RowActionable -

View File

@ -57,7 +57,7 @@ class TestTableViewCell: UITableViewCell, ConfigurableCell {
return TestTableViewCellOptions.EstimatedHeight
}
func configure(with item: T, isPrototype: Bool) {
func configure(with item: T) {
textLabel?.text = item.title
}