nghialv / Hakuba

:cherry_blossom: Cellmodel-driven tableview manager
MIT License
474 stars 40 forks source link

Breaking constraints with self.tableView.separatorStyle = .None #14

Open kafejo opened 8 years ago

kafejo commented 8 years ago

You calculate cell height with the separator so if there isn't one, it breaks the constraints.

 func calculateHeightForConfiguredSizingCell(cell: MYTableViewCell) -> CGFloat {
        cell.bounds = CGRectMake(0, 0, tableView?.bounds.width ?? UIScreen.mainScreen().bounds.width, cell.bounds.height)
        cell.setNeedsLayout()
        cell.layoutIfNeeded()

        let size = cell.contentView.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize)
        return size.height + 1.0
    }
kafejo commented 8 years ago

I have created pull request for that #15