I am a student and pretty new to programming. I am trying to learn Objective-C/Swift in my spare time. I made a game using spriteKit with swift that has multiple menus/scenes. <
Swift 3
This will remove the current view controller from the memor
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
guard let viewControllers = navigationController?.viewControllers,
let index = viewControllers.index(of: self) else { return }
navigationController?.viewControllers.remove(at: index)
}