@@ -41,10 +41,14 @@ - (void)setSelectedIndex:(NSInteger)selectedIndex
4141
4242- (void )setFontSize : (NSInteger )fontSize
4343{
44- UIFont *font = [UIFont boldSystemFontOfSize : fontSize];
44+ UIFont *font = [UIFont systemFontOfSize : fontSize];
4545 [_attributes setObject: font forKey: NSFontAttributeName ];
4646 [self setTitleTextAttributes: _attributes
4747 forState: UIControlStateNormal];
48+ UIFont *fontBold = [UIFont boldSystemFontOfSize: fontSize];
49+ [_attributes setObject: fontBold forKey: NSFontAttributeName ];
50+ [self setTitleTextAttributes: _attributes
51+ forState: UIControlStateSelected];
4852}
4953
5054- (void )setBackgroundColor : (UIColor *)backgroundColor
@@ -74,7 +78,8 @@ - (void)setActiveTextColor:(UIColor *)textColor
7478 #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
7579 __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
7680 if (@available (iOS 13.0 , *)) {
77- [self setTitleTextAttributes: @{NSForegroundColorAttributeName : textColor}
81+ [_attributes setObject: textColor forKey: NSForegroundColorAttributeName ];
82+ [self setTitleTextAttributes: _attributes
7883 forState: UIControlStateSelected];
7984 }
8085 #endif
@@ -87,8 +92,9 @@ - (void)setTintColor:(UIColor *)tintColor
8792 __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
8893 if (@available (iOS 13.0 , *)) {
8994 [self setSelectedSegmentTintColor: tintColor];
90- [self setTitleTextAttributes: @{NSForegroundColorAttributeName : tintColor}
91- forState: UIControlStateNormal];
95+ [_attributes setObject: tintColor forKey: NSForegroundColorAttributeName ];
96+ [self setTitleTextAttributes: _attributes
97+ forState: UIControlStateNormal];
9298 }
9399#endif
94100}
0 commit comments