I am working in an iOS Swift 2.0 application. I can’t understand for myself how to set the text on the right side of the UITableViewCell immediately before the chevron expansion character (besides creating a custom cell.accessoryView ).
UITableViewCell
cell.accessoryView
Here is a screenshot of the “Application Settings” doing exactly what I am trying to achieve.
In the Builder interface, when setting up the cell, select the "Correct part" style:
Then assign the value to the detailTextLabel property:
detailTextLabel
cell.detailTextLabel.text = "Kilroy Was Here"
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "CellId") ?? UITableViewCell(style: UITableViewCellStyle.value1, reuseIdentifier: "CellId") cell.accessoryType = UITableViewCellAccessoryType.disclosureIndicator cell.textLabel?.text = "Main text" cell.detailTextLabel?.text = "Detail Text" return cell }