BButton
BButton copied to clipboard
Unable to set button type via Interface Builder
I didn't figure out how I can set button type via Interface Builder, maybe it is not even possible, I don't know, but it should be mentioned.
Hi, I think this may help, see this commit of the read me : https://github.com/aw-emberex/BButton/blob/a43e61ce8edd8e50599c86837bf0bd38ba8b8379/README.md
Scroll to the section on IB.
Paul, your link was helpful. I got the color working now, but how do you set the icon via interface builder?
e.g. by creating a category for bbutton
.h file: @property (nonatomic) NSInteger faIcon;
.m file:
- (NSInteger)faIcon { return 0; }
- (void)setFaIcon:(NSInteger)faIcon { if (self.titleLabel.text == nil || [self.titleLabel.text isEqualToString:@""]) { [self setTitle:@" " forState:UIControlStateNormal]; [self addAwesomeIcon:faIcon beforeTitle:YES]; NSMutableString *str = [self.titleLabel.text mutableCopy]; CFStringTrimWhitespace((__bridge CFMutableStringRef)str); self.titleLabel.text = str; } else { [self addAwesomeIcon:faIcon beforeTitle:YES]; } }
and then you can set the Icon in the same way as the color via property key "faIcon".