Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kafejo opened this issue Oct 15, 2015 · 1 comment
Open

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

kafejo opened this issue Oct 15, 2015 · 1 comment

Comments

@kafejo
Copy link

kafejo commented Oct 15, 2015

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
Copy link
Author

kafejo commented Oct 15, 2015

I have created pull request for that #15

@kafejo kafejo closed this as completed Oct 15, 2015
@kafejo kafejo reopened this Oct 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant