A category or extension for UIButton to set solid background color as background image.
Add this to your Podfile
pod 'UIButton+BackgroundColor'
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];