What is the earliest method to put in and trigger a performSegue?

Hi,
I need the fastest, earliest programmatic transition possible from one vc to another. So I need to have

Code Block
 performSegue(withIdentifier: "fromEntryToVoting", sender: nil)

performed as fast as possible so the transition happens as quickly as possible. But the vc containing this method should remain in the stack.

It won't work from ViewDidLoad but will work from viewDidAppear.
Is there an earlier method I can use to put my performeSegue so it will be performed asap?
Could you explain the use case and the problem ?
You have a VC1 displayed.
From there, you will segue to another VC2 (via a button ? Automatically ?)

If so, perform is called from VC1, not in viewDidLoad, nor ViewDidAppear (users need to have time to see VC1), but from the IBAction.

But the vc containing this method should remain in the stack. 

This depends on the type of segue. But are you sure you don't want a navigationView here ?
Have a look here:
https://stackoverflow.com/questions/25966215/whats-the-difference-between-all-the-selection-segues

So, please explain use case.
Sure.
VC1 is entry of app. I only need that in the stack so I can unwind later to it
VC1 only action is the performeSegue to VC2.

VC2 is the main controller of app with lots of work and variables alive.
When a user logs out of the app, I need all states to be destroyed.

I found the simplest way, instead of setting each variable to default when the user logs out, is to unwind to VC1 (so VC2 is destroyed) then VC1 immediately loads VC2, fresh, with all variables on their default values.

So the goal is to perform segue to VC2 from VC1 as fast as possible so users don't even see VC1.

That may not be the most legit way to achieve this, but the unwind makes absolutely certain that all states of VC2 die.
What is the earliest method to put in and trigger a performSegue?
 
 
Q