One Logo Pool Ball
SwiftUI · IOS API REFERENCE

RotationGesture

struct · iOS 13.0+ · Deprecated in iOS 100000.0 · SDK 27.1

nonisolated struct RotationGesture

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

Members (3)

get · iOS 13.0+ · Deprecated in iOS 100000.0

minimumAngleDelta

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

The minimum delta required before the gesture succeeds.

set · iOS 13.0+ · Deprecated in iOS 100000.0

minimumAngleDelta

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

The minimum delta required before the gesture succeeds.

init · iOS 13.0+ · Deprecated in iOS 100000.0

init

TypeScript
static init(minimumAngleDelta?: _SwiftUICore_Angle): RotationGesture
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 →