I am trying to launch openImmersiveSpace, but seem like there is an issue with the openImmersiveSpace Task.
Error: Static method 'buildExpression' requires that 'Task<OpenImmersiveSpaceAction.Result, Never>' conform to 'View'
Here is the code and the error shows up on the "Task" line.
import SwiftUI
import RealityKit
import RealityKitContent
struct TestView: View {
@Environment(\.openImmersiveSpace) var openImmersiveSpace
@Environment(\.dismissImmersiveSpace) var dismissImmersiveSpace
var body: some View {
VStack{
Text("Open Full Immersive & switch to NextViewArea")
NavigationLink {
Task {
await openImmersiveSpace(id: "ImmersiveSpace")
}
NextViewArea()
} label:{
Label(" Enter Full Immersive Space")
}
}
}
}
How can I move onto the next view area in the floating window while also launching full immersive space. Any help would be much appreciated.