I encountered an issue in my app where, on iOS 17 and later, if a ScrollView contains LazyViews and the user performs a PullToRefresh, the view becomes jittery.
I attempted to record it, but it's hard to observe, so I would be grateful if you could build the sample with the additional commit on your local machine for more details. In the app I'm developing, due to different conditions, the screen jitter is more pronounced than in the provided sample.
After investigating, it seems that the issue lies with the DispatchQueue.main.async when monitoring the offset. However, directly notifying causes SwiftUI to output a warning, so we have opted to use onPreferenceChange instead.
Excellent PR! Thank you (again) for the contribution!
I tested this out and it works great. iOS 17 has had lots of jitter issues that I couldn't quite figure out, but this seems to do it!
I encountered an issue in my app where, on iOS 17 and later, if a ScrollView contains LazyViews and the user performs a PullToRefresh, the view becomes jittery. I attempted to record it, but it's hard to observe, so I would be grateful if you could build the sample with the additional commit on your local machine for more details. In the app I'm developing, due to different conditions, the screen jitter is more pronounced than in the provided sample.
After investigating, it seems that the issue lies with the
DispatchQueue.main.async
when monitoring the offset. However, directly notifying causes SwiftUI to output a warning, so we have opted to useonPreferenceChange
instead.