Setting Segmented Control Foreground Color

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?

Setting Segmented Control Foreground Color
 
 
Q