diff --git a/React/Views/RCTSegmentedControl.m b/React/Views/RCTSegmentedControl.m index adbde608e23..343643150a6 100644 --- a/React/Views/RCTSegmentedControl.m +++ b/React/Views/RCTSegmentedControl.m @@ -39,6 +39,21 @@ super.selectedSegmentIndex = selectedIndex; } +- (void)setTintColor:(UIColor *)tintColor +{ + [super setTintColor:tintColor]; +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \ + __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0 + if (@available(iOS 13.0, *)) { + [self setSelectedSegmentTintColor:tintColor]; + [self setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]} + forState:UIControlStateSelected]; + [self setTitleTextAttributes:@{NSForegroundColorAttributeName: tintColor} + forState:UIControlStateNormal]; + } +#endif +} + - (void)didChange { _selectedIndex = self.selectedSegmentIndex;