Premise
I'm writing an app (SwiftUI/RealityKit) in which I instantiate ARview directly in code inside ARViewContainer: UIViewRepresentable - as per template (I don't use RealityComposer).
The management of the AR in my application is the endpoint of a Navigation, so the user enters and exits the AR scenes multiple times, changing a series of parameters each time.
Problem
I noticed that every time arView is created, the system generates a different name for the Scene (automatically generated and assigned to the ARView): scene-1, scene-2, ..., scene-n.
Question
Is this normal, or does it mean that by recreating the ARView object several times the individual scenes remain in memory (generating something that could be a memory leak)?
The same thing happens if I move the declaration of the arView variable as a global fileprivate in the source (which would be much better for me, to be able to access the arView object from multiple parts of the code).
Is this behavior in the name of the scenes normal? Or am I causing a problem in some way? And if so, what is the right procedure to follow?
Thank you very much,
Alessandro
I'm writing an app (SwiftUI/RealityKit) in which I instantiate ARview directly in code inside ARViewContainer: UIViewRepresentable - as per template (I don't use RealityComposer).
The management of the AR in my application is the endpoint of a Navigation, so the user enters and exits the AR scenes multiple times, changing a series of parameters each time.
Problem
I noticed that every time arView is created, the system generates a different name for the Scene (automatically generated and assigned to the ARView): scene-1, scene-2, ..., scene-n.
Question
Is this normal, or does it mean that by recreating the ARView object several times the individual scenes remain in memory (generating something that could be a memory leak)?
The same thing happens if I move the declaration of the arView variable as a global fileprivate in the source (which would be much better for me, to be able to access the arView object from multiple parts of the code).
Is this behavior in the name of the scenes normal? Or am I causing a problem in some way? And if so, what is the right procedure to follow?
Thank you very much,
Alessandro