0
votes

I'm learning swift and i made an app having VC0 as initial view controller and from storyboard i have three push segues to VC1 and VC2 and VC3 using three buttons in VC0 successively, I'm not using navigation controller neither "rootviewconroller" concept, each of VC1, VC2 and VC3 has button performs unwind segue to VC0, deinit of each VC1,VC2 and VC3 is called successfully but VC0 deinit never been called !!, also my memory usage is increasing when i keep pushing and unwinding through the button, Am i missing something, How to avoid such a memory leak ?

1
Include the minimal code you can that exhibits the problem. Maybe a url to a github commit or post the code in the question.Daniel T.

1 Answers

0
votes

It's pretty much up to the OS to decide when to deinit view controllers. If I'm understanding your post correctly, V0 is at the base of your view controller stack regardless of which view controller you're on. Because of that, the OS will see it as needed and won't deinit it.