Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 685 Bytes

File metadata and controls

31 lines (19 loc) · 685 Bytes

UIButton+BackgroundColor

A category or extension for UIButton to set solid background color as background image.

Installation

CocoaPods

Add this to your Podfile

pod 'UIButton+BackgroundColor'

Usage

Import <UIButton+BackgroundColor.h>, then you can set background color with state for your UIButton using:

[self.blueButton setBackgroundColor:[UIColor blueColor] forState:UIControlStateNormal];

You can also set background color default appearance for UIButton

[[UIButton appearance] setBackgroundColor:[UIColor blueColor] forState:UIControlStateNormal];

Contact

@luugiathuy