0

I have a project with a View Controller A (a home page), that then segues to View Controllers B, from there to C, and from there to D. So A >> B >> C >> D.

I use Unwind Segue to go from D to A and have set it up properly, but I am NOT using a navigation controller at all (it is impossible due to the lack of real estate on the device screen when it adds the Navigation Item and the complexity of existing views' pre-existing constraints in my project).

My question is: Does Unwind Segueing from D back to A properly dismiss from memory View Controllers B,C and D (which I will not be using again), when no navigation controller set up is used, just normal segues?

It wasn't clear to me from any tutorial/documentations I came across, as they all used Navigation Controllers, which is not helpful in my case. Many thanks for any help.

Apneist
  • 396
  • 7
  • 17
  • You can see it by yourself in memory graph tool. If I understand correctly, unwind without nav controller will dismiss all B,C and D view controllers, and they will be deallocated. – Roman Truba Mar 06 '17 at 14:34
  • Thanks for your answer, my memory does not really decrease back to the initial level when "A" was loaded, which makes me worry that only D is deallocated from memory, but not B and C. Question is whether Xcode "knows" you had to pass from B and C in order to get to D, hence dismisses them all from memory or not – Apneist Mar 06 '17 at 14:36
  • well the fact that memory does not decrease is not a marker that you have a real problem. Also, you could self-retain your B and C inside with blocks or some operations. So, the answer is when you running your app, do unwind, press `Debug Memory Graph` button in Xcode and see, are B,C,D alive or not. Otherwise it is only guesswork – Roman Truba Mar 06 '17 at 14:45

0 Answers0