How to apply a tintColor to a UIImage? How to apply a tintColor to a UIImage? objective-c objective-c

How to apply a tintColor to a UIImage?


If you are just supporting iOS 7 you can use tintColor and UIImageRenderingModeAlwaysTemplate

This article covers that:

https://www.captechconsulting.com/blogs/ios-7-tutorial-series-tint-color-and-easy-app-theming

If you need to support an earlier version you may want to consider this thread

How would I tint an image programmatically on the iPhone?


Swift 4, copy-paste solution

@IBOutlet weak var iconImageView: UIImageView!iconImageView.image = UIImage(imageLiteralResourceName: "myImageName").withRenderingMode(.alwaysTemplate)iconImageView.tintColor = UIColor.red