Post

Replies

Boosts

Views

Activity

Reply to Detecting when the user lifted finger off the screen on a scrollview
Came here with the same question and you were so close! At least in 2026 on Xcode 27 Beta, don't have older versions handy. All you need to do is swap the .gesture() modifier with .simultaneousGesture(): struct TestView: View { var body: some View { ScrollView { VStack(spacing: 0) { Rectangle() .foregroundStyle(.green) .frame(height: 700) } } .simultaneousGesture(DragGesture().onEnded({ _ in print("Drag gesture ended") })) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’26
Reply to Detecting when the user lifted finger off the screen on a scrollview
Came here with the same question and you were so close! At least in 2026 on Xcode 27 Beta, don't have older versions handy. All you need to do is swap the .gesture() modifier with .simultaneousGesture(): struct TestView: View { var body: some View { ScrollView { VStack(spacing: 0) { Rectangle() .foregroundStyle(.green) .frame(height: 700) } } .simultaneousGesture(DragGesture().onEnded({ _ in print("Drag gesture ended") })) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’26