Thanks for this awesome series Stewart! I added this line to my temperature formatter and it dropped the units: formatter.unitOptions = .temperatureWithoutUnit
@Vadian-i7y5 ай бұрын
Very intelligible tutorial, kudos. A little simplification: _formatted()_ provides a _percent_ modifier. *Text(hour.precipitationChance.formatted(.percent))*
@kadeus5 ай бұрын
Hi Stewart! I have a question, but it's not related to this video. I couldn't find any video related to custom keyboards on your channel. Do you have any video tutorials on that topic?
@StewartLynch5 ай бұрын
I do not. Sorry. Good idea though. I wll add to my list.
@mettlex26215 ай бұрын
I'm not 100% sure, but the units will show whenever you are in an area that uses one but you want to show the other. In your example, you are showing Cupertino but displaying celsius. If you were displaying in F then there would be no units.
@StewartLynch5 ай бұрын
I don’t think it has anything to do with the location you are in. It is all based on what your settings are. When I travel to the US I still see Celsius
@mettlex26215 ай бұрын
@@StewartLynch I believe you're correct. I was playing around with showing temperatures in both units and was using the measurement converted toUnit function and I noticed a discrepancy in the displaying of the unit. In one case it was there and the other it was not. This is the extension, maybe you will spot the flaw :) extension Measurement { func temperatureString(for unit: UnitTemperature) -> String { self.converted(to: unit).formatted(.measurement(width: .narrow, usage: .asProvided, numberFormatStyle: .number.precision(.fractionLength(0)))) } }