<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVKit",
  "identifier" : "/documentation/AVKit/AVExperienceController/withTransitionGroup(body:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AVKit"
    ],
    "preciseIdentifier" : "s:5AVKit22AVExperienceControllerC19withTransitionGroup4bodySayxGyAC0eF0Vy_xGzYaXE_tYas8SendableRzlFZ"
  },
  "title" : "withTransitionGroup(body:)"
}
-->

# withTransitionGroup(body:)

Coordinates multiple experience transitions to perform together as a single visual transition.

```
@discardableResult nonisolated(nonsending) static func withTransitionGroup<ChildTransitionResult>(body: @_lifetime(0: copy 0) (inout AVExperienceController.TransitionGroup<ChildTransitionResult>) async -> Void) async -> [ChildTransitionResult] where ChildTransitionResult : Sendable
```

## Parameters

`body`

A closure that adds transitions to the group using `addTransition(operation:)`.

## Return Value

An array of transition results in the order transitions were added.

## Discussion

Use this method when you need to transition multiple [`AVExperienceController`](/documentation/AVKit/AVExperienceController) instances
simultaneously, creating a smooth, coordinated animation.

All transitions prepare concurrently, then perform together once preparation completes.
Individual transitions may succeed or fail independently — the group continues with
successful transitions and collects results for all.

```swift
let results = await AVExperienceController.withTransitionGroup { group in
    for controller in controllers {
        group.addTransition {
            await controller.transition(to: .multiview)
        }
    }
}

// Check which transitions succeeded
for (index, result) in results.enumerated() {
    if case .reversed(let reason) = result {
        print("Controller \(index) failed: \(reason)")
    }
}
```

---

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)