For some reason, .scrollPosition() is causing stuttering on physical devices, this may be a bug, To solve this simply replace the line, .scrollPosition(id: $activePhotoID, anchor: .bottomTrailing) to this, .scrollPosition(id: Binding.init(get: { return "" }, set: { newValue in activePhotoID = newValue }), anchor: .bottomTrailing)
You no need print(error.localizedDescprition) it's a bad practice, if you have an error, in console you're not able real all error message and can be confused And why you're not separate network layer with viewModel and View ?
I was able to learn about the functionality of scrollTargetLayout and scrollPosition. Thank you. I have one question, though. Is it okay to execute isLoading = true within the scope of a Task in the fetchPhotos function? I'm wondering if it's okay to manipulate something defined with @State outside of the main thread. I would be very happy if someone who knows could tell me.
For some reason, .scrollPosition() is causing stuttering on physical devices, this may be a bug, To solve this simply replace the line,
.scrollPosition(id: $activePhotoID, anchor: .bottomTrailing)
to this,
.scrollPosition(id: Binding.init(get: {
return ""
}, set: { newValue in
activePhotoID = newValue
}), anchor: .bottomTrailing)
Awesome job!
Awesome job!, i am also waiting your video.👍
Amazing work
Great content 😌
You no need print(error.localizedDescprition) it's a bad practice, if you have an error, in console you're not able real all error message and can be confused
And why you're not separate network layer with viewModel and View ?
I was able to learn about the functionality of scrollTargetLayout and scrollPosition. Thank you.
I have one question, though.
Is it okay to execute isLoading = true within the scope of a Task in the fetchPhotos function?
I'm wondering if it's okay to manipulate something defined with @State outside of the main thread.
I would be very happy if someone who knows could tell me.
Since the task is not a detached task, it’s not necessary to use MainActor, If it’s inside the detached task, then we must use MainActor.
Thank U, 👍👍👍
Soo Cool Ta much !
👋