uitableviewheightconstraintsios8.3

iOS 8.3 - UITableView cell height bug


On previous iOS versions cell height was working perfectly now it doesn't get the explicit height I give at the uitableview delegate. By the time, I updated to 8.3 rendering is so bad. It goes smaller and towards right.

Am implementing a custom cell using a xib file and Swift.

I saw some 1-2 similar posts but I couldn't comment below due to reputation. So I have already try to add constraints to awakeNib and updateContraints methods but when I try to add a constraint it crashes.

[Edit]

While trying to add constraint, I get this error message:

-> 'Impossible to set up layout with view hierarchy unprepared for constraint.'

And when tried to setup a visual formatConstraint V:|[contentView]|

-> Parse error and View doesn't have superview

Thanks.


Solution

  • I have found out what was going wrong.

    Before the iOS 8.3 update the table view should somehow auto calculating the height of the custom cell and everything was working properly.

    My mistake was that i believed that i had correctly connect the table view's data source and delegate at the controller. I had only connected the datasource. As a result as soon as i connected the delegate everything was working properly.

    myTableView.datasource = self    
    myTableView.delegate = self  <- this was missing