Adding the little arrow to the right side of a cell in an iPhone TableView Cell

Eric Brotto picture Eric Brotto · Jun 12, 2011 · Viewed 96.8k times · Source

This should be simple enough.

I have an iPhone app with a TableView. How do I add the little classic arrow to the righthand side of each cell?

Answer

EmptyStack picture EmptyStack · Jun 12, 2011

Just set the respective accessoryType property of UITableViewCell.

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

In Swift 3,

cell.accessoryType = .disclosureIndicator