App/Sources/ReorientGesture.swift

00ea029d0652da12d0f4237769e7020b72cfa7f3
fold/App/Sources/ReorientGesture.swift history · blame · raw

10 lines · 519 bytes

1 symbol in this file
 1import SwiftUI
 2
 3extension View {
 4    /// Lets a one-finger horizontal drag drive the session's turn-over or rotate step: a rightward
 5    /// drag across the model's on-screen width turns it fully, a leftward drag turns it back, and
 6    /// the step completes when the finger lifts at t = 1. Releasing below 1 leaves it where it is.
 7    func reorientGesture(_ session: FoldSession) -> some View {
 8        modifier(StepDragGesture(session: session, kinds: [.turnOver, .rotate], begin: session.beginReorientDrag))
 9    }
10}