SystemCoordinator.GroupImmersionStyles
An asynchronous sequence that contains one or more incoming immersion styles for you to process.
Declaration
struct GroupImmersionStylesOverview
When a participant in an activity changes the immersion style of their immersive space, the system adds the style to this sequence. Configure an asynchronous task to monitor this sequence and process results when they arrive.
The following example shows you how to configure this task and use it to iterate over the available items. The systemCoordinator variable contains the session’s SystemCoordinator object.
Task.detached {
for await immersionStyle in systemCoordinator.groupImmersionStyle {
if let immersionStyle {
// Open an immersive space with the same style.
}
else {
// Dismiss the immersive space.
}
}
}