Просмотр похож на
Код: Выделить всё
VStack {
ScrollView
InputButton
}
Код: Выделить всё
.highPriorityGesture(
LongPressGesture(minimumDuration: 0.01, maximumDistance: 200)
.sequenced(before: DragGesture(minimumDistance: .zero, coordinateSpace: .global))
.updating($pressState, body: { (value, state, transaction) in
switch value {
case .first(true):
// start press
case .second(true, let drag):
state = .started
if let drag = drag {
//Calculate drag
}
break
default:
state = .inactive
// on end
}
})
.onEnded({ value in
// on end
}),
including: .gesture
)
Как я могу отменить любой другой жест, когда я начинаю этот жест?
Большое спасибо
Подробнее здесь: https://stackoverflow.com/questions/787 ... us-gesture