From 8477cea35bb085f11a4b54da3c9eee27190e6423 Mon Sep 17 00:00:00 2001 From: Max Sokolov Date: Fri, 19 Aug 2016 15:40:21 +0300 Subject: [PATCH 1/2] remove isPrototype --- .../Presentation/Views/AutolayoutTableViewCell.swift | 2 +- .../Presentation/Views/ConfigurableTableViewCell.swift | 2 +- Demo/Classes/Presentation/Views/NibTableViewCell.swift | 2 +- Sources/ConfigurableCell.swift | 2 +- Sources/HeightStrategy.swift | 2 +- Sources/TableDirector.swift | 2 +- Sources/TableRow.swift | 6 +++--- Tests/TableKitTests.swift | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Demo/Classes/Presentation/Views/AutolayoutTableViewCell.swift b/Demo/Classes/Presentation/Views/AutolayoutTableViewCell.swift index 28e7248..6f5f7c4 100644 --- a/Demo/Classes/Presentation/Views/AutolayoutTableViewCell.swift +++ b/Demo/Classes/Presentation/Views/AutolayoutTableViewCell.swift @@ -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 diff --git a/Demo/Classes/Presentation/Views/ConfigurableTableViewCell.swift b/Demo/Classes/Presentation/Views/ConfigurableTableViewCell.swift index c98db9d..3366dee 100644 --- a/Demo/Classes/Presentation/Views/ConfigurableTableViewCell.swift +++ b/Demo/Classes/Presentation/Views/ConfigurableTableViewCell.swift @@ -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 diff --git a/Demo/Classes/Presentation/Views/NibTableViewCell.swift b/Demo/Classes/Presentation/Views/NibTableViewCell.swift index 5c980f9..74b4a27 100644 --- a/Demo/Classes/Presentation/Views/NibTableViewCell.swift +++ b/Demo/Classes/Presentation/Views/NibTableViewCell.swift @@ -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)" } diff --git a/Sources/ConfigurableCell.swift b/Sources/ConfigurableCell.swift index d0e9a88..6c37e1f 100644 --- a/Sources/ConfigurableCell.swift +++ b/Sources/ConfigurableCell.swift @@ -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 { diff --git a/Sources/HeightStrategy.swift b/Sources/HeightStrategy.swift index 1fbc0cd..7723bdd 100644 --- a/Sources/HeightStrategy.swift +++ b/Sources/HeightStrategy.swift @@ -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() diff --git a/Sources/TableDirector.swift b/Sources/TableDirector.swift index b34d62c..6794b24 100644 --- a/Sources/TableDirector.swift +++ b/Sources/TableDirector.swift @@ -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 diff --git a/Sources/TableRow.swift b/Sources/TableRow.swift index 8cd6d2c..d4f56e3 100644 --- a/Sources/TableRow.swift +++ b/Sources/TableRow.swift @@ -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 Date: Fri, 19 Aug 2016 15:40:54 +0300 Subject: [PATCH 2/2] bump podspec and readme --- README.md | 2 +- TableKit.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0e1778a..f740cc1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Build Status Swift 2.2 compatible Carthage compatible - CocoaPods compatible + CocoaPods compatible Platform iOS License: MIT

diff --git a/TableKit.podspec b/TableKit.podspec index 0153a1a..b1ff19d 100644 --- a/TableKit.podspec +++ b/TableKit.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = 'TableKit' s.module_name = 'TableKit' - s.version = '0.9.2' + s.version = '0.9.3' s.homepage = 'https://github.com/maxsokolov/TableKit' s.summary = 'Type-safe declarative table views. Swift 2.2 is required.'