commit
aaafb0d28d
|
|
@ -25,7 +25,7 @@ class MainController: UIViewController {
|
|||
|
||||
let clickAction = TableRowAction<String, ConfigurableTableViewCell>(.click) { [weak self] (data) in
|
||||
|
||||
switch data.path.row {
|
||||
switch data.indexPath.row {
|
||||
case 0:
|
||||
self?.performSegueWithIdentifier("autolayoutcells", sender: nil)
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class AutolayoutTableViewCell: UITableViewCell, ConfigurableCell {
|
|||
@IBOutlet var titleLabel: UILabel!
|
||||
@IBOutlet var subtitleLabel: UILabel!
|
||||
|
||||
func configure(string: T, isPrototype: Bool) {
|
||||
func configure(with string: T, isPrototype: Bool) {
|
||||
|
||||
titleLabel.text = LoremIpsumTitle
|
||||
subtitleLabel.text = LoremIpsumBody
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import TableKit
|
|||
|
||||
class ConfigurableTableViewCell: UITableViewCell, ConfigurableCell {
|
||||
|
||||
func configure(text: String, isPrototype: Bool) {
|
||||
func configure(with text: String, isPrototype: Bool) {
|
||||
|
||||
accessoryType = .DisclosureIndicator
|
||||
textLabel?.text = text
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class NibTableViewCell: UITableViewCell, ConfigurableCell {
|
|||
|
||||
@IBOutlet weak var titleLabel: UILabel!
|
||||
|
||||
func configure(number: Int, isPrototype: Bool) {
|
||||
func configure(with number: Int, isPrototype: Bool) {
|
||||
titleLabel.text = "\(number)"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.1-blue.svg" alt="CocoaPods 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>
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public protocol ConfigurableCell: ReusableCell {
|
|||
|
||||
static func estimatedHeight() -> CGFloat?
|
||||
static func defaultHeight() -> CGFloat?
|
||||
func configure(_: T, isPrototype: Bool)
|
||||
func configure(with _: T, isPrototype: Bool)
|
||||
}
|
||||
|
||||
public extension ReusableCell where Self: UITableViewCell {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class TableRow<ItemType, CellType: ConfigurableCell where CellType.T == I
|
|||
// MARK: - RowConfigurable -
|
||||
|
||||
public func configure(cell: UITableViewCell, isPrototype: Bool) {
|
||||
(cell as? CellType)?.configure(item, isPrototype: isPrototype)
|
||||
(cell as? CellType)?.configure(with: item, isPrototype: isPrototype)
|
||||
}
|
||||
|
||||
// MARK: - RowActionable -
|
||||
|
|
|
|||
|
|
@ -47,14 +47,14 @@ public class TableRowActionData<ItemType, CellType: ConfigurableCell where CellT
|
|||
|
||||
public let item: ItemType
|
||||
public let cell: CellType?
|
||||
public let path: NSIndexPath
|
||||
public let indexPath: NSIndexPath
|
||||
public let userInfo: [NSObject: AnyObject]?
|
||||
|
||||
init(item: ItemType, cell: CellType?, path: NSIndexPath, userInfo: [NSObject: AnyObject]?) {
|
||||
|
||||
self.item = item
|
||||
self.cell = cell
|
||||
self.path = path
|
||||
self.indexPath = path
|
||||
self.userInfo = userInfo
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Pod::Spec.new do |s|
|
|||
s.name = 'TableKit'
|
||||
s.module_name = 'TableKit'
|
||||
|
||||
s.version = '0.9.1'
|
||||
s.version = '0.9.2'
|
||||
|
||||
s.homepage = 'https://github.com/maxsokolov/TableKit'
|
||||
s.summary = 'Type-safe declarative table views. Swift 2.2 is required.'
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class TestTableViewCell: UITableViewCell, ConfigurableCell {
|
|||
return TestTableViewCellOptions.EstimatedHeight
|
||||
}
|
||||
|
||||
func configure(item: T, isPrototype: Bool) {
|
||||
func configure(with item: T, isPrototype: Bool) {
|
||||
textLabel?.text = item.title
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue