sooon
sooon

Reputation: 4878

iOS - Untint UIImage

I know how to tint an UIImage:

UIImage* originalImage = curiv.image;
UIImage* imageForRendering = [originalImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
curiv.image = imageForRendering;
curiv.tintColor = [UIColor RedColor];

But how to untint to original UIImage?

Upvotes: 3

Views: 97

Answers (1)

Viral Savaj
Viral Savaj

Reputation: 3389

You can try like this way

UIImage* originalImage = curiv.image;
UIImage* imageForRendering = [originalImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
curiv.image = imageForRendering;
UIColor *prevTintColor = curiv.tintColor;
//set new Tint color as Red
curiv.tintColor = [UIColor redColor];


//Now if you want to set back previous color
curiv.tintColor=prevTintColor;

Enjoy Coding !!

Upvotes: 2

Related Questions