I am working with a UITableView that uses the standard UITableViewCell. I have the style set to "Right Detail" in Interface Builder.
Each cell looks correct until I scroll it out of the frame and back into the frame, at which point the detail label becomes blank.
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = self.tableView!.dequeueReusableCellWithIdentifier("id");
cell.detailTextLabel!.text = "value";
return cell;
}
When I call sizeToFit()
, the label appears again, but overlaps the detail indicator on the right side of the cell.
I gave tried the answers in this question: UITableViewCell detailTextLabel disappears when scrolling, but the only one that works is to subclass the UITableViewCell and I would like to, if possible, not subclass it.
Any ideas?