@@ -41,10 +41,14 @@ - (void)setSelectedIndex:(NSInteger)selectedIndex
41
41
42
42
- (void )setFontSize : (NSInteger )fontSize
43
43
{
44
- UIFont *font = [UIFont boldSystemFontOfSize : fontSize];
44
+ UIFont *font = [UIFont systemFontOfSize : fontSize];
45
45
[_attributes setObject: font forKey: NSFontAttributeName ];
46
46
[self setTitleTextAttributes: _attributes
47
47
forState: UIControlStateNormal];
48
+ UIFont *fontBold = [UIFont boldSystemFontOfSize: fontSize];
49
+ [_attributes setObject: fontBold forKey: NSFontAttributeName ];
50
+ [self setTitleTextAttributes: _attributes
51
+ forState: UIControlStateSelected];
48
52
}
49
53
50
54
- (void )setBackgroundColor : (UIColor *)backgroundColor
@@ -74,7 +78,8 @@ - (void)setActiveTextColor:(UIColor *)textColor
74
78
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
75
79
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
76
80
if (@available (iOS 13.0 , *)) {
77
- [self setTitleTextAttributes: @{NSForegroundColorAttributeName : textColor}
81
+ [_attributes setObject: textColor forKey: NSForegroundColorAttributeName ];
82
+ [self setTitleTextAttributes: _attributes
78
83
forState: UIControlStateSelected];
79
84
}
80
85
#endif
@@ -87,8 +92,9 @@ - (void)setTintColor:(UIColor *)tintColor
87
92
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
88
93
if (@available (iOS 13.0 , *)) {
89
94
[self setSelectedSegmentTintColor: tintColor];
90
- [self setTitleTextAttributes: @{NSForegroundColorAttributeName : tintColor}
91
- forState: UIControlStateNormal];
95
+ [_attributes setObject: tintColor forKey: NSForegroundColorAttributeName ];
96
+ [self setTitleTextAttributes: _attributes
97
+ forState: UIControlStateNormal];
92
98
}
93
99
#endif
94
100
}
0 commit comments