One Logo Pool Ball
SwiftUI · IOS API REFERENCE

RotateGesture

struct · iOS 17.0+ · SDK 27.1

nonisolated struct RotateGesture

A gesture that recognizes a rotation motion and tracks the angle of the rotation. A rotate gesture tracks how a rotation event sequence changes. To recognize a rotate gesture on a view, create and configure the gesture, and then add it to the view using the ``View/gesture(_:including:)`` modifier. Add a rotate gesture to a ``Rectangle`` and apply a rotation effect: struct RotateGestureView: View { @State private var angle = Angle(degrees: 0.0) var rotation: some Gesture { RotateGesture() .onChanged { value in angle = value.rotation } } var body: some View { Rectangle() .frame(width: 200, height: 200, alignment: .center) .rotationEffect(angle) .gesture(rotation) } }

Members (4)

init · iOS 27.0+

init

TypeScript
static initMinimumAngleDeltaInputKinds(minimumAngleDelta?: _SwiftUICore_Angle, inputKinds?: _SwiftUICore_GestureInputKinds): RotateGesture
Swift declaration
nonisolated init(minimumAngleDelta: Angle = .degrees(1), inputKinds: GestureInputKinds = .all)

Creates a rotation gesture with a minimum delta for the gesture to start, and the input kinds the gesture recognizes. - Parameters: - minimumAngleDelta: The minimum delta required before the gesture starts. The default value is a one-degree angle. - inputKinds: A set of input kinds that this gesture recognizes. If not specified, the gesture will recognize all applicable input kinds that a person can use to perform it.

get · iOS 17.0+

minimumAngleDelta

TypeScript
get minimumAngleDelta(): _SwiftUICore_Angle
Swift declaration
var minimumAngleDelta: Angle

The minimum delta required before the gesture succeeds.

set · iOS 17.0+

minimumAngleDelta

TypeScript
set minimumAngleDelta(value: _SwiftUICore_Angle)
Swift declaration
var minimumAngleDelta: Angle

The minimum delta required before the gesture succeeds.

init · iOS 17.0+

init

TypeScript
static initMinimumAngleDelta(minimumAngleDelta?: _SwiftUICore_Angle): RotateGesture
Swift declaration
nonisolated init(minimumAngleDelta: Angle = .degrees(1))

Creates a rotation gesture with a minimum delta for the gesture to start. - Parameter minimumAngleDelta: The minimum delta required before the gesture starts. The default value is a one-degree angle.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →