0
votes

enter image description here

enter image description here

enter image description here

I have two storyboards first storyboard rootviewcontroller contains two containers each container points to 1) first embed segue to a view controller which in turn contains a container to other view controllers. 2) second embed segue to other storyboard

on app first launch we will go to first flow which is login once login succeeds i will call perform segue to other storyboard by removing all views from current container.

But all view controllers not releasing when i moved to other storyboard which has its own navigation controller.

1

1 Answers

0
votes

I'm not sure I understand what do you mean by saying you are segueing by removing all the views but...

If I got your question right, you are using two storyboards to support two flows of your app.

Flow 1. App registration process

Flow 2. (App already registered) so go directly to the screen after register

You don't need to have two separate story board that have the same job, just because it's a separate flow.

On your appDelegate check if you registered and change the root view controller programatically so the user will jump to the right screen.

Note: you will have to add an identifier to the optional root view controller

self.window?.rootViewController = mainStoryboard?.instantiateViewControllerWithIdentifier("tabBarVCID")

In case deinit not being called you may have a strong reference cycle which prevents release of the VCs

In the Resolving Strong Reference Cycles Between Class Instances section of The Swift Programming Language: Automatic Reference Counting, Apple describes how to address this:

Swift provides two ways to resolve strong reference cycles when you work with properties of class type: weak references and unowned references.

Weak and unowned references enable one instance in a reference cycle to refer to the other instance without keeping a strong hold on it. The instances can then refer to each other without creating a strong reference cycle.