<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/RotateGesture3D",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15RotateGesture3DV"
  },
  "title" : "RotateGesture3D"
}
-->

# RotateGesture3D

A gesture that recognizes 3D rotation motion and tracks the angle and axis
of the rotation.

```
nonisolated struct RotateGesture3D
```

## Overview

You can constrain this gesture
to recognize rotation about a specific 3D axis.
For example, `RotateGesture3D(constrainedToAxis: .x)` creates a gesture
that recognizes rotation only around the global X axis. The axis you provide will
be normalized.

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 [`gesture(_:including:)`](/documentation/SwiftUI/View/gesture(_:including:))
modifier.

## Topics

### Creating the gesture

[`init(constrainedToAxis:minimumAngleDelta:)`](/documentation/SwiftUI/RotateGesture3D/init(constrainedToAxis:minimumAngleDelta:))

Creates a rotation gesture with a minimum delta for the gesture to
start and axis to constrain measurement of rotation.

[`init(constrainedToAxis:minimumAngleDelta:inputKinds:)`](/documentation/SwiftUI/RotateGesture3D/init(constrainedToAxis:minimumAngleDelta:inputKinds:))

Creates a rotation gesture with a minimum delta for the gesture to
start, an axis to constrain measurement of rotation, and the input
kinds the gesture should recognize.

[`minimumAngleDelta`](/documentation/SwiftUI/RotateGesture3D/minimumAngleDelta)

The minimum angle delta before the gesture becomes active.

[`constrainedAxis`](/documentation/SwiftUI/RotateGesture3D/constrainedAxis)

An axis around which the rotation is constrained.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)