What gesture can execute code only while user placing their finger on the screen in SwiftUI?
- 阅读更多 关于 What gesture can execute code only while user placing their finger on the screen in SwiftUI?
问题 What gesture can execute code only while user placing their finger on the screen? Running certain code should not be Effect of the Cause(gesture), what I want is running certain code while user holding their finger on the screen, and if the user took their finger off the code stops running For example, //some view .unknownGesture{ // running this code only while user placing their finger on the screen } 回答1: Here is possible solution .gesture( DragGesture(minimumDistance: 0) .onChanged() {