It may look a dumb question (sorry if it is), but usually, in my apps, I have this rootVC to inherit with others VCs. So came to me that I have multiples instances of this root. For example, in AppDelegate
I call my first view as:
let window = UIWindow(frame: UIScreen.main.bounds)
let root = SplashViewController(nibName: "SplashViewController", bundle: nil)
window.rootViewController = UINavigationController(rootViewController: root)
window.makeKeyAndVisible()
self.window = window
Then SplashViewController
inherits from my RootViewController
where I can make some view configurations. But, when I call another VC (like InitialViewController
) which also inherit from my root, I'm creating new instance from my root or using the same?
And do you think that it is a good practice?
I was reading and searching but I couldn't find or understand clearly in the api reference: https://developer.apple.com/reference/uikit/uiviewcontroller
Any Suggestion? Thanks in advance!