How can I change the cell height to make the UILabel fit? I am not using Auto-Layout in my project.
Also, the TableViewCell text is set in the cellForRowAtIndexPath
.
Code:
var commentsArray: [String] = []
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell:TableViewCell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! TableViewCell;
if self.commentsArray.count > indexPath.row{
cell.commentsText.text = commentsArray[commentsArray.count - 1 - indexPath.row]
cell.commentsText.font = UIFont.systemFontOfSize(15.0)
}
return cell
}
Any ideas?