I am currently creating a game that requires a user to switch view controllers - when switching between levels.
Accessing a level from the menu page I use present modally. when returning back to the menu page I use the following code:
@IBOutlet weak var Menu: UIButton!
@IBAction func returntoMenu(_ sender: UIButton) {
self.dismiss(animated: true, completion: nil)
}
This means that when the user presses the menu button they return to the menu page. However I noticed that every time the menu button is pressed the memory usage goes up rather than down. This suggests that the level isn't being closed properly.
does anyone know what might be causing this problem,
thank you in advance!