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?
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
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!
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
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.
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?
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?
Good catch.
Stewart, what a fantastic style you have! Can't wait to see your other lessons!
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
may be nonisolated func if we want to run code other than main actor ?
May be I am missing something
@StewartLynch Everyone gets answer other than me, may be i asked wrong question
He said he just followed Apples example but we dont know why Apple did this
23:25 can you explain how using the string initializer explicitly solves this issue?
THe Text iew initializer’s default is a LocalizedStringKey so using the initializer (.init) converts the markdown to a localizedString
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!
I was just following Apple’s example here.
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
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.
async task whats wrong with that , is there any doc that you recommend ? asking because i want to learn best practices
apple delegates these tutorials to their worst programmers to not take up their best programmers time
All your videos are amazing Stewart, thank you! Will be watching keenly for the next few videos
Great Video! But weird! Your Vancouver temp when you recorded is the same as the Duluth, MN temp now!
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?
I am following Apple’s example here
Brilliant beginning, Stewart. So many helpful hints here. I look forward to the rest of the series. Thanks as always!
Glad you enjoyed it
Great work! Thank you!
Glad you think so