Clicky

iOS Dev Nugget 47 Generating Copies of an Image With Different Colors

.

Need to run a code review on your codebase? Hire me

Sometimes you'll want to generate several versions of the same image with different colors. For example you might want to generate images for different states of a button or perhaps your app allows users to pick their own colors for certain icon-like images. You can do it easily with UIImage categories from Matt Gemmell. For e.g., to generate a version in red, you can do:

UIImage* newImage = [originalImage imageTintedWithColor:[UIColor redColor]];


Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No

.

.

Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter

.

View archives of past issues