How to go back to a view controller that wasn't presented without memory leak

I'm trying to back to my initial view controller, but it wasn't presented if the user was already logged in. So, when the user logs out, i want to go back to the initial view controller. i'm currently using a segue, but that would cause a memory leak if used too much. I can't user an unwind segue since the initial view controller was never presented. How would i do this?

Thanks.

i'm currently using a segue, but that would cause a memory leak if used too much.

That's not clear. How do you know it is a memory leak. It is probably more access to a non existing object. It would be surprising it is due to number of use.

Please show the code where you segue.

How to go back to a view controller that wasn't presented without memory leak
 
 
Q