improvements
This commit is contained in:
parent
a5ff6c520b
commit
b7398a2986
|
|
@ -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)"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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