0

When I start my app and then check the debug inspector I (the once where I can drag around my app/views in 3d) I see that all old views is showing up in the background of the current VC/view.

Does that mean that my old views is running in the background? Is there a way to reset the root VC so that the old views doesn't get stacked up?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Kiwo Tew
  • 1,491
  • 1
  • 22
  • 39
  • look at viewWillDisappear and also check this link: http://stackoverflow.com/questions/24668818/how-to-dismiss-view-controller-in-swift – Dan Beaulieu Oct 27 '15 at 12:34
  • @DanBeaulieu Thanks but that is for dismissing VC. I don't want to dismiss my VC I only wonder why I can see all my VC's stacked? – Kiwo Tew Oct 27 '15 at 12:39
  • Are you using a navigation controller? If so then the view controllers will be on the stack so that you can go back to them. You can manipulate the navigation controllers stack directly to reset the root view controller – Paulw11 Oct 27 '15 at 12:48
  • @Paulw11 Yes. How can I anipulate the navigation controllers stack? I am entering by modal segue and not push. But I still want the new VC to become the first one in the navigation controller stack – Kiwo Tew Oct 27 '15 at 18:48
  • Have you read the UInavigationController documentation? You can simply manipulate the `viewControllers` array but you may be better off rethinking your app design. Why use a navigation controller if you aren't navigating through a stack of view controllers? – Paulw11 Oct 27 '15 at 19:35

0 Answers0