If you know the specific position, you can do it at the moment when the table is loading the elements if what you want is to add an initial image (Option 1), if what you want is that when you touch the cell change the image you can do it the following way (Option 2)
-----------
Option 1
-----------
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if(indexPath.row == //index of your cell){
let frame = CGRect(x: 220, y: 12, width: 10, height: 5)
let headerImageView = UIImageView(frame: frame)
let image: UIImage = UIImage(named: "arrow-up")!
headerImageView.image = image
}
}
-----------
Option 2
-----------
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if(indexPath.row == //index of your cell){
let frame = CGRect(x: 220, y: 12, width: 10, height: 5)
let headerImageView = UIImageView(frame: frame)
let image: UIImage = UIImage(named: "arrow-up")!
headerImageView.image = image
}
}