I have two views (as in full screens, view controllers) in my iOS Swift application, lets call them view A and view B.
View A is a menu that will open View B when you press a button. View B displays images one at the time and will eventually go back to View A.
View B is opened when you press a button in view A. It is opened using an IB show segue. View A is opened again using a method call to:
let viewController:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("<name here>")
self.presentViewController(viewController, animated: true, completion: nil)
If I go through the loop of opening View B looking at all the pictures then through View A to B again an so on, the memory usage will just continue to increase. I though that the ARC system would get rid of such old views but that seems to not be the case. What is the correct way to avoid this?