Category for UIButton to tint the image or background.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Example
.gitignore
LICENSE
README.md
UIButton+tintImage.h
UIButton+tintImage.m
UITintedButton.podspec

README.md

UITintedButton

Ever wanted to tint a UIButton like you do with a UIBarButtonItem or a UINavigationItem? Here you go!

UITintedButton

This category adds two instance methods and two class methods to UIButton:

-(void)setImageTintColor:(UIColor *)color forState:(UIControlState)state;
-(void)setBackgroundTintColor:(UIColor *)color forState:(UIControlState)state;

+(void)tintButtonImages:(NSArray *)buttons withColor:(UIColor *)color forState:(UIControlState)state;
+(void)tintButtonBackgrounds:(NSArray *)buttons withColor:(UIColor *)color forState:(UIControlState)state;

Installation

CocoaPods

pod 'UITintedButton'

Manual

Drag UIButton+tintImage.h and UIButton+tintImage.m.

Usage

#import UIButton+tintImage.h

// Tint single buttons
[button setImageTintColor:[UIColor redColor] forState:UIControlStateNormal];
[button setBackgroundTintColor:[UIColor redColor] forState:UIControlStateNormal];

// Tint multiple buttons
[UIButton tintButtonImages:@[button1, button2, button3] withColor:[UIColor redColor] forState:UIControlStateNormal];
[UIButton tintButtonBackgrounds:@[button1, button2, button3] withColor:[UIColor redColor] forState:UIControlStateNormal];