Hello Everyone,
In the example code, I'm trying to convert from Fahrenheit to Celsius, but I'm not succeeding. Output is always in Fahrenheit. My code is this:
func formattedTemperature(_ temp: Measurement<UnitTemperature>) -> String {
let tempC = temp.converted(to: .celsius)
return tempC.formatted(.measurement(width: .abbreviated, usage: .weather))
}
In the simulator I also went into the settings and switched in General->Language/Region from F to C. But this also had not effect.
Would anyone have an idea how to correct this?
Thanks and best regards, Patrick