4. WeatherKit: HourlyForecast and UIUpgrade

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024
  • НаукаНаука

Комментарии • 7

  • @jessielinden2961
    @jessielinden2961 4 месяца назад

    Thanks for this awesome series Stewart! I added this line to my temperature formatter and it dropped the units: formatter.unitOptions = .temperatureWithoutUnit

  • @Vadian-i7y
    @Vadian-i7y 4 месяца назад

    Very intelligible tutorial, kudos. A little simplification: _formatted()_ provides a _percent_ modifier. *Text(hour.precipitationChance.formatted(.percent))*

  • @kadeus
    @kadeus 3 месяца назад

    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?

    • @StewartLynch
      @StewartLynch  3 месяца назад +1

      I do not. Sorry. Good idea though. I wll add to my list.

  • @mettlex2621
    @mettlex2621 4 месяца назад

    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.

    • @StewartLynch
      @StewartLynch  4 месяца назад

      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

    • @mettlex2621
      @mettlex2621 4 месяца назад

      @@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))))
      }
      }