1

On my UITableViewCell I set imageView.image. This is a simple black icon on a transparent background.

I want to invert it, when the cell is selected/highlighted, which can be done by setting the cell's imageView.highlightedImage.

I've tried this but that returns nil, and also tried this which turns transparent parts white so you see a white square when cell is selected.

What's the proper way to invert a UIImage for this purpose (which works for both normal and retina screens)? So, I only want to invert the colours; alpha should be preserved.

Community
  • 1
  • 1
meaning-matters
  • 21,929
  • 10
  • 82
  • 142
  • Related? http://stackoverflow.com/questions/6672517/is-programmatically-inverting-the-colors-of-an-image-possible – Marco Feb 09 '14 at 23:36

0 Answers0