Category for UIButton to tint the image or background.
Objective-C Ruby
Switch branches/tags
Nothing to show
Latest commit f5de47b Nov 9, 2015 @filipstefansson Updated podspec
Permalink
Failed to load latest commit information.
Example Created the example project. May 15, 2014
.gitignore
LICENSE Minor changes Nov 9, 2015
README.md
UIButton+tintImage.h Minor changes Nov 9, 2015
UIButton+tintImage.m
UITintedButton.podspec Updated podspec Nov 9, 2015

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];