Merge pull request #31 from maxsokolov/develop

Remove isPrototype
This commit is contained in:
Max Sokolov 2016-08-19 16:41:39 +04:00 committed by GitHub
commit 0186da5452
10 changed files with 12 additions and 12 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

@ -4,7 +4,7 @@
<a href="https://travis-ci.org/maxsokolov/TableKit"><img src="https://api.travis-ci.org/maxsokolov/TableKit.svg" alt="Build Status" /></a>
<a href="https://developer.apple.com/swift"><img src="https://img.shields.io/badge/Swift_2.2-compatible-4BC51D.svg?style=flat" alt="Swift 2.2 compatible" /></a>
<a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible" /></a>
<a href="https://cocoapods.org/pods/tablekit"><img src="https://img.shields.io/badge/pod-0.9.2-blue.svg" alt="CocoaPods compatible" /></a>
<a href="https://cocoapods.org/pods/tablekit"><img src="https://img.shields.io/badge/pod-0.9.3-blue.svg" alt="CocoaPods compatible" /></a>
<img src="https://img.shields.io/badge/platform-iOS-blue.svg?style=flat" alt="Platform iOS" />
<a href="https://raw.githubusercontent.com/maxsokolov/tablekit/master/LICENSE"><img src="http://img.shields.io/badge/license-MIT-blue.svg?style=flat" alt="License: MIT" /></a>
</p>

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

@ -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.'

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
}