Skip to content

sartak/IITintedImageView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

IITintedImageView is a subclass of UIView (not UIImageView due to UIKit implementation details) that supports tinting the chosen image. For best results use a white foreground and transparent background.

IITintedImageView *imageView = [[IITintedImageView alloc] init];
imageView.image = [UIImage imageNamed:@"hello-world.png"];
imageView.tint = [UIColor redColor];

It's also UIAppearance ready!

[[IITintedImageView appearance] setTintColor:[UIColor greenColor]];

IITintedImageView is not a subclass of UIImageView because UIImageView optimizes rendering its attached UIImage, so there is no hook point for overriding that. This means you need to be careful when adding an IITintedImageView to your xib or storyboard; drag out a UIView (NOT a UIImageView) and set its class to IITintedImageView.

About

UIImageView + tintColor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published