Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion HMSegmentedControl/HMSegmentedControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,12 @@ - (NSAttributedString *)attributedTitleAtIndex:(NSUInteger)index {

// the color should be cast to CGColor in order to avoid invalid context on iOS7
UIColor *titleColor = titleAttrs[NSForegroundColorAttributeName];


// Core Animation objects (in this case, CATextLayer) won't reflect a change in the current trait collection. So we need to resolve explicitly.
if (@available(iOS 13.0, *)) {
titleColor = [titleColor resolvedColorWithTraitCollection: UITraitCollection.currentTraitCollection];
}

if (titleColor) {
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:titleAttrs];

Expand Down