1. WeatherKit: Introduction and CurrentWeather Conditions

Поділитися
Вставка
  • Опубліковано 1 жов 2024

КОМЕНТАРІ • 23

  • @schlumpfpapa6810
    @schlumpfpapa6810 4 місяці тому +1

    Hi, great Video.
    One question though:
    At 13 min 31 s in ForecastView's body's task modifier. If you set isLoading to false after the Task.detached, it would be executed immediately, wouldn't it?

  • @DHaacke
    @DHaacke 27 днів тому

    Stewart, what a fantastic style you have! Can't wait to see your other lessons!

  • @Prashant-7
    @Prashant-7 4 місяці тому +1

    1) can you pl expalin why we use task.detached ? , 2) temperature property from response does contains C, F in it because i. can see MeasurementFormatter created but we did not pass anything that says it is temperature unit
    sorry if it is silly questions
    Thanks

    • @Prashant-7
      @Prashant-7 4 місяці тому

      may be nonisolated func if we want to run code other than main actor ?
      May be I am missing something

    • @Prashant-7
      @Prashant-7 4 місяці тому

      @StewartLynch Everyone gets answer other than me, may be i asked wrong question

    • @milanlabus1582
      @milanlabus1582 25 днів тому

      He said he just followed Apples example but we dont know why Apple did this

  • @spiffylogic
    @spiffylogic 3 місяці тому

    23:25 can you explain how using the string initializer explicitly solves this issue?

    • @StewartLynch
      @StewartLynch  3 місяці тому

      THe Text iew initializer’s default is a LocalizedStringKey so using the initializer (.init) converts the markdown to a localizedString

  • @nickdev32
    @nickdev32 3 місяці тому

    Hi Stewart, great video. Quick question - why do we need detached tasks that run on the main thread inside the task modifier? My understanding is that task modifier runs on the main thread already. And if the weather manager functions are already running on background threads, the task modifier should assign the values to your @State properties on the main thread. Lmk, thanks again!

    • @StewartLynch
      @StewartLynch  3 місяці тому +1

      I was just following Apple’s example here.

    • @milanlabus1582
      @milanlabus1582 25 днів тому

      I was wondering the same i cant seem to understand why Apple did this in their tutorials, are they trying to future proof it for some change they are planning to make to how task works? or maybe they just delegate these tutorials to people who arent skilled in SwiftUI

  • @indiekiduk
    @indiekiduk 4 місяці тому

    The async tasks and formatting don’t seem standard SwiftUI and have bugs. Eg the loading spinner won’t show and the label won’t reformat on region settings change. If this is from the weaktherkit sample then sadly it’s common that these other teams don’t use SwiftUI correctly.

    • @Prashant-7
      @Prashant-7 4 місяці тому

      async task whats wrong with that , is there any doc that you recommend ? asking because i want to learn best practices

    • @milanlabus1582
      @milanlabus1582 25 днів тому +1

      apple delegates these tutorials to their worst programmers to not take up their best programmers time

  • @indianfyre
    @indianfyre 4 місяці тому

    All your videos are amazing Stewart, thank you! Will be watching keenly for the next few videos

  • @dibjr
    @dibjr 4 місяці тому

    Great Video! But weird! Your Vancouver temp when you recorded is the same as the Duluth, MN temp now!

  • @tazman7689
    @tazman7689 4 місяці тому

    Great video, look forward to the rest of the series. As always, well presented. I would like to know why the task is detached and really what it means to detach a task? With WeatherManager why is it a singleton and not an observable class, is there a benefit to that?

    • @StewartLynch
      @StewartLynch  4 місяці тому

      I am following Apple’s example here

  • @holycrosscv
    @holycrosscv 4 місяці тому

    Brilliant beginning, Stewart. So many helpful hints here. I look forward to the rest of the series. Thanks as always!

  • @abdouett3676
    @abdouett3676 4 місяці тому

    Great work! Thank you!