Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simultaneous MagnificationGesture and DragGesture with SwiftUI

Tags:

ios

swift

swiftui

The Apple Maps app allows for simultaneous two-finger drag and magnification. I have tried implementing this functionality with SwiftUI gestures. Simultaneous rotation and magnification works as expected, but simultaneous drag and magnification does not. Maybe there is a way to conform to the Gesture protocol for custom behavior?

like image 347
Brett Avatar asked Oct 22 '25 04:10

Brett


1 Answers

I was not able to achieve simultaneous drag and magnification. From my experience DragGesture works only with one touch and ends as soon as there are two touches on the screen. I appears that only gestures requiring the same amount of touches can be simultaneous in SwiftUI. There is also no direct access to touch events to implement custom gesture recognisers. Hope this will change in the future.

like image 194
SirDeleck Avatar answered Oct 23 '25 18:10

SirDeleck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!