Home > AI > IOS > SwiftUI >

.gesture

Summary: Attaches a gesture to the view with a lower precedence than gestures defined by the view.

Image(systemName: "square.and.arrow.up")
            .offset(dragAmount)
            .gesture(
                DragGesture().updating($dragAmount) { value, state, transaction in
                    state = value.translation
                }
            )

Leave a Reply