Sadly, more than one year has passed and..
var body: some View {
Image("main")
.resizable()
.scaledToFit()
.offset(
x: viewState.width + control.translation.width,
y: viewState.height + control.translation.height
)
.scaleEffect(control.zooming)
.gesture(dragging)
.simultaneousGesture(zooming)
}
where:
var dragging: some Gesture {
DragGesture()
.updating($control) { value, state, transaction in
print(value, state, transaction)
state = .dragging(translation: value.translation)
}
}
var zooming: some Gesture {
MagnificationGesture()
.updating($control) { value, state, transaction in
print(value, state, transaction)
state = .zooming(zoom: value)
}
}
Doesn't work...... Either you Drag or you Magnify. SimultaneousGesture is seriously bugged.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: