Setting simultaneous gestures with MagnificationGesture
and DragGesture
do not work together since drag gesture works on single touch and magnification works on two touch. I am either able to magnify with two touches or drag with one touch with below approach.
Image(uiImage: "image_file_name")
.resizable()
.scaledToFit()
.scaleEffect(zoomFactor)
.offset(offset)
.gesture(
MagnificationGesture()
.updating($zoomFactor) { value, scale, transaction in
scale = value > 1 ? value : 1
}
.simultaneously(with: DragGesture()
.onChanged { val in
offset = val.translation
}
)
)
What I want is enabling user the simultaneously drag and magnify with two touches an Image
.
As far as I understand custom gestures are not an available option, and since drag gesture works with one touch, how to achieve it?