<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GroupActivities",
  "identifier" : "/documentation/GroupActivities/SpatialTemplateElementDirection/alignedWith(appAxis:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Group Activities"
    ],
    "preciseIdentifier" : "s:15GroupActivities31SpatialTemplateElementDirectionV11alignedWith7appAxisAcA0cdeJ0V_tFZ"
  },
  "title" : "alignedWith(appAxis:)"
}
-->

# alignedWith(appAxis:)

Creates a direction that orients the participant to look along
the specified axis in the direction of the app’s content.

```
static func alignedWith(appAxis: SpatialTemplateElementAxis) -> SpatialTemplateElementDirection
```

## Parameters

`appAxis`

The axis for the participant to look along.

## Return Value

A direction type that faces the specified seat position.

## Discussion

Use this function to create a seat that faces perpendicular to the
app. For example, you might use it to mimic a long bench or stadium-style
seating. The following code shows how to create such a line of seats:

```swift
struct Line: SpatialTemplate {
    var elements: [any SpatialTemplateElement] {
        (-2...2).map { seatIndex in
            .seat(
                position: .app.offsetBy(x: Double(seatIndex) * 2, z: 3),
                direction: .alignedWith(appAxis: .z)
            )
        }
    }
}
```

---

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)