File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
FontAwesomeIconFactory-Extensions/Button Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 1010
1111@interface FAButton (){
1212 NIKFontAwesomeIcon _icon;
13+ NSInteger _iconSize;
1314}
1415
1516@property (nonatomic , strong ) CAShapeLayer *circleLayer;
@@ -18,6 +19,8 @@ @interface FAButton(){
1819
1920@implementation FAButton
2021
22+
23+
2124- (void )awakeFromNib
2225{
2326 [super awakeFromNib ];
@@ -27,12 +30,22 @@ - (void)awakeFromNib
2730}
2831
2932- (void )setIcon : (NIKFontAwesomeIcon)icon {
33+
34+ if (_iconSize == 0 ){
35+ _iconSize = (NSInteger ) (self.bounds .size .height *0.8 );
36+ }
37+ [self setIcon: icon withSize: _iconSize];
38+
39+ }
40+
41+ - (void )setIcon : (NIKFontAwesomeIcon)icon withSize : (float )size {
42+
3043 _icon = icon;
44+ _iconSize = size;
3145 NIKFontAwesomeIconFactory *factory = [NIKFontAwesomeIconFactory buttonIconFactory ];
3246 [factory setColors: @[self .tintColor]];
33- [factory setSize: self .bounds.size.height * 0.8 ];
47+ [factory setSize: _iconSize ];
3448 [self setImage: [factory createImageForIcon: icon] forState: UIControlStateNormal];
35-
3649
3750}
3851
@@ -54,3 +67,4 @@ - (void)drawCircleButton:(UIColor *)color fill:(UIColor *)fillColor
5467}
5568
5669@end
70+
You can’t perform that action at this time.
0 commit comments