diff --git a/Tablet/TableDirector.swift b/Tablet/TableDirector.swift index 6bc4d97..f0c8374 100644 --- a/Tablet/TableDirector.swift +++ b/Tablet/TableDirector.swift @@ -26,12 +26,13 @@ import UIKit public class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate { public private(set) weak var tableView: UITableView? - public weak var scrollDelegate: UIScrollViewDelegate? + private weak var scrollDelegate: UIScrollViewDelegate? private var sections = [TableSectionBuilder]() - public init(tableView: UITableView) { + public init(tableView: UITableView, scrollDelegate: UIScrollViewDelegate? = nil) { super.init() + self.scrollDelegate = scrollDelegate self.tableView = tableView self.tableView?.delegate = self self.tableView?.dataSource = self diff --git a/Tablet/TableRowBuilder.swift b/Tablet/TableRowBuilder.swift index 222e0cc..8cedf6c 100644 --- a/Tablet/TableRowBuilder.swift +++ b/Tablet/TableRowBuilder.swift @@ -43,5 +43,17 @@ public class TableRowBuilder CGFloat { return CGFloat(CellType.estimatedHeight()) + } +} + +public class LolRowBuilder { + + public init() { + + } + + public func append(items: [ItemType], cellType: CellType.Type) { + + } } \ No newline at end of file diff --git a/TabletDemo/Classes/Presentation/Controllers/MainController.swift b/TabletDemo/Classes/Presentation/Controllers/MainController.swift index 8e3330f..45ad1fc 100644 --- a/TabletDemo/Classes/Presentation/Controllers/MainController.swift +++ b/TabletDemo/Classes/Presentation/Controllers/MainController.swift @@ -9,6 +9,19 @@ import UIKit import Tablet +class LolCell: UITableViewCell, ConfigurableCell { + + typealias T = String + + func configure(str: T) { + + } + + static func estimatedHeight() -> Float { + return 44 + } +} + class MainController: UIViewController { @IBOutlet weak var tableView: UITableView! { @@ -28,9 +41,14 @@ class MainController: UIViewController { let rows2 = TablePrototypeRowBuilder(items: ["1", "1", "1", "1"]) + // animation task rows.remove(index: 0, animated: .None) tableDirector += rows tableDirector += rows2 + + let lolBuilder = LolRowBuilder() + + lolBuilder.append(["1", "2", "3"], cellType: LolCell.self) } } \ No newline at end of file