How to add a cutsom accessory image to a Table View Cell

Each table view cell has an accessory type on the right. You can check which one should be shown by default in Interface Builder (those are none, tick box (aka checkmark), disclosure and detail disclosure chevrons). You can however use your own graphics in this place.

All we need to do is add our own UIImageView as a subview to the cell’s view. Sounds complex, I know – but it’s just as easy as adding a background image to a table view.

We add our custom accessory image in the tableView:cellForRowAtIndexPath method like so:

Make sure you add this before the return cell call.

About Jay Versluis

Jay is a medical miracle known as Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.