Saturday, November 21, 2026
HomeiOS Developmentios - SwiftUI : ScrollView contact ended

ios – SwiftUI : ScrollView contact ended

[ad_1]

I’m in search of a strategy to know when person has stopped touching a ScrollView. It’s not a easy faucet (with a TapGesture). It’s when person releases his finger after scrolling.

I’ve tried so as to add a DragGesture however solely .onChanged() is triggered, not .onEnded().

ScrollView {
   /* Textual content Views in a VStack */
}
.gesture(DragGesture()
    .onChanged() { _ in
        print("OnChanged")
    }
    .onEnded() { _ in
        print("OnEnded") // <- By no means referred to as
    })

Perhaps it could possibly be additionally when ScrollView did cease scrolling. However I do not discover a method neither. In UIKit there’s delegate methodology referred to as scrollViewDidScroll however not in SwiftUI.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments