Upon app start, i have a login screen, which is an instance of LoginViewController and on success, i.e. after my user is successfully logged in, the main content of my app is being shown using the performSegue(withIdentifier identifier: String, sender: Any?) method to an instance of a UITabBarController. Unfortunately i deinit() is not being called on my LoginViewController after the segue. This does not happen due to any reference cycles i might have in my LoginViewController, because i explicitely checked for those.
Since a login screen is only required once upon app start, i was wondering if there is a best practice to be able to make sure that my LoginViewController is being deallocated after the segue?
Maybe using a segue is just not the right way to achive this, because
from what i understand, the conclusion of a similar question Deinit not called on Show Detail segue was the fact, that using a showDetail-segue is the same as using a modal presentation, i.e. both controllers keep a reference to each other and deinit() will not be called in either of them. Is this really ecpected behavior, or am i missing something?
Update: The reason i care so much, is the fact that i am using RxSwift and my LoginViewController is subscribed on several Observables, so after my app leaves the LoginViewController, i want to make sure to set my collected DisposeBag to nil. Would it be finde to do this in the ViewDidDisappear() of my LoginViewController?