callAsFunction(id:)
Presents an immersive space for the scene with the specified identifier.
Declaration
@discardableResult @MainActor func callAsFunction(id: String) async -> OpenImmersiveSpaceAction.ResultParameters
- id:
The identifier of the immersive space to present.
Discussion
Don’t call this method directly. SwiftUI calls it when you call the openImmersiveSpace action with a string identifier:
await openImmersiveSpace(id: "planet")For information about how Swift uses the callAsFunction() method to simplify call site syntax, see Methods with Special Names in The Swift Programming Language.