nghialv / Hakuba

:cherry_blossom: Cellmodel-driven tableview manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Breaking constraints with self.tableView.separatorStyle = .None

kafejo opened this issue · comments

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
    }

I have created pull request for that #15