I've read several posts on this topic: UILabel - auto-size label to fit text?, Swift - Adjusting fontSize to fit the width of the layout (programmatically), and http://www.raywenderlich.com/87975/dynamic-table-view-cell-height-ios-8-swift. It seems that I am following exactly what these posts suggested but it seems to not work.
The following is currently what my simulator shows:
I've set the constraints correctly, I think and I wrote the following like so:
override func viewDidLoad() {
super.viewDidLoad()
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 150
}
And I wrote:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! CathyTaskLogTableViewCell
cell.messageLabel.sizeToFit()
cell.messageLabel.text = "If you'd like to have more control over the way objects are synced, you can keep them in the local datastore until you are ready to save them yourself using saveInBackground. To manage the set of objects that need to be saved, you can again use a label. The fromPinWithName: method on PFQuery makes it easy to fetch just the objects you care about."
return cell
}
And I've set the lines lines
to 0
like so:
For the label
, I set all four constraints and the width and height constraints. And my constraints are like so:
However, it is not causing all of my lines to show. Any suggestions on how to fix this? Thank you so much in advance!!!