Skip to content

Commit

Permalink
[iOS] fix activeFontStyle prop being override by fontStyle (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
kesha-antonov committed Jun 17, 2020
1 parent 199ab5a commit b12d38e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions ios/RNCSegmentedControlManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,18 @@ - (UIView *)view {
NSInteger fontSize =
json[@"fontSize"] ? [RCTConvert NSInteger:json[@"fontSize"]] : 13.0;
UIFont *font = [UIFont systemFontOfSize:fontSize];
UIFont *activeFont = [UIFont boldSystemFontOfSize:fontSize];
if (json[@"fontFamily"]) {
UIFont *tempFont = [UIFont fontWithName:json[@"fontFamily"]
size:fontSize];
if (tempFont != nil) {
font = tempFont;
activeFont = tempFont;
}
}

NSDictionary *attributes = [NSDictionary
dictionaryWithObjectsAndKeys:font, NSFontAttributeName, color,
NSForegroundColorAttributeName, nil];
NSDictionary *activeAttributes = [NSDictionary
dictionaryWithObjectsAndKeys:activeFont, NSFontAttributeName, color,
NSForegroundColorAttributeName, nil];
[view setTitleTextAttributes:attributes forState:UIControlStateNormal];
[view setTitleTextAttributes:activeAttributes
forState:UIControlStateSelected];
}
}
#endif
Expand Down

0 comments on commit b12d38e

Please sign in to comment.