I am programming a game using scenekit that has different levels, that are different files (uiviewcontrollers) (level1.swift, level2.swift...) When you complete a level, you can replay it. What i have noticed, is when you start the game, it uses about 33 mb memory. Now when you press a replay button which presents the level 1 viewcontroller again, the game uses about 60 mb of memory.
So the question is, Is there a way i could somehow remove the level 1 when i present it again? Something like: Level1. RemoveFromMemory Self.presentViewController(level1)?