Now that foregroundColor() has been depreciated, I have noticed that I can't substitute foregroundStyle() for foregroundColor() in UISegmentedControl.appearance:
UISegmentedControl.appearance().setTitleTextAttributes([.foregoundColor: UIColor.orange], for: .selected)
Is there an alternate method to set the segmented control foreground color?