TQEasyIconButton is a UIButton Category. Easy way to set titleEdgeInsets
,imageEdgeInsets
make icon in left,right,top,bottom.
lib is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TQEasyIconButton"
-
Set icon & title for button.
[self.demoButton setTitle:@"Button" forState:UIControlStateNormal]; [self.demoButton setImage:@"icon" forState:UIControlStateNormal];
-
Set icon left,title right
[self.demoButton setIconInLeft]; // or //[self.demoButton setIconInLeftWithSpacing:0];
[self.demoButton setIconInRight]; // or //[self.demoButton setIconInRightWithSpacing:0];
[self.demoButton setIconInBottom]; // or //[self.demoButton setIconInBottomWithSpacing:0];
[self.demoButton setIconInTop]; // or //[self.demoButton setIconInTopWithSpacing:0];