I have a "life counter" in my game, and when it reaches 0 = dead - I want to move from the scene to another UIView - this is a game with a view - with statistics and a button to return to the screen home (first UIViewController with buttons to launch games, etc.
Here is the code of how I switch to game view
class GameScene: SKScene,SKPhysicsContactDelegate { var viewController: UIViewController?
this works to represent the game by viewing, but I think that I do not “order” or transfer the scene. because if I do this in a loop:
Start of the game → Game on top → Back to the main screen → Start of the game → Game on top ...
I see that memory usage is growing on every cycle :) I think I'm just adding scenes but not deleting them?
Sorry - I'm fresh at that. We will be very grateful for your experience! :)
source share