Last active
December 13, 2024 08:28
-
-
Save VAndrJ/c89feaa927c29cd9b54fdcb9b3544f16 to your computer and use it in GitHub Desktop.
List scroll issue iOS 18+, Xcode 16+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State private var translationWidth = 0.0 | |
var body: some View { | |
VStack { | |
List(0...1000, id: \.self) { | |
Text("\($0)") | |
} | |
Text("\(translationWidth)") | |
.padding(16) | |
} | |
.highPriorityGesture( | |
DragGesture() | |
.onChanged { | |
translationWidth = $0.translation.width | |
} | |
.onEnded { _ in | |
translationWidth = 0 | |
} | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment