diff --git a/Tablet/TableDirector.swift b/Tablet/TableDirector.swift index 101d3dc..1679148 100644 --- a/Tablet/TableDirector.swift +++ b/Tablet/TableDirector.swift @@ -81,8 +81,7 @@ public class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate } public func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { - - return UITableViewAutomaticDimension + return sections[indexPath.section].items[indexPath.row].defaultHeight } // MARK: UITableViewDataSource - configuration @@ -92,13 +91,12 @@ public class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate } public func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return sections[section].numberOfRowsInSection + return sections[section].numberOfRows } public func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let row = sections[indexPath.section].items[indexPath.row] - let cell = tableView.dequeueReusableCellWithIdentifier(row.reusableIdentifier, forIndexPath: indexPath) if cell.frame.size.width != tableView.frame.size.width { diff --git a/Tablet/TableRow.swift b/Tablet/TableRow.swift index 7f48b76..1c59fe4 100644 --- a/Tablet/TableRow.swift +++ b/Tablet/TableRow.swift @@ -24,6 +24,7 @@ public protocol Row { var reusableIdentifier: String { get } var estimatedHeight: CGFloat { get } + var defaultHeight: CGFloat { get } func configure(cell: UITableViewCell) } @@ -39,6 +40,10 @@ public class TableRow