I'm making a simple texting app for practice and the UITableView has lots of cells containing messages.
It works well with one-line messages but, as you can see on the bottom, with multi-line texts the size of the UITableViewCell starts getting in the way and cutting the message short. Just in case, here's the code for my cellForRowAtIndexPath method:
internal func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = UITableViewCell()
if usernames[indexPath.row] == PFUser.currentUser()?.username {
cell = tableView.dequeueReusableCellWithIdentifier("text")!
} else {
cell = tableView.dequeueReusableCellWithIdentifier("reply")!
(cell.viewWithTag(2) as! UILabel).text = usernames[indexPath.row]
}
(cell.viewWithTag(1) as! UILabel).text = messages[indexPath.row]
return cell
}
Basically I just need a solution that will enable this app to support multi-line messages. Thanks in advance for any help!