I'm an android developer and quiet new to iOS development and have a very basic question I guess.
I have read that it is best practice nowadays to use multiple storyboards for multiple view controllers and navigate through them programmatically like:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let viewController = storyboard.instantiateViewController(withIdentifier :"viewController") as! UIViewController
self.present(viewController, animated: true, completion: nil)
Lets say I have two storyboards. In the first one I only have one ViewController and in the second I have two ViewControllers. I launch the app with the first storyboard and with its ViewController. After something like clicking a button I want to present the next storyboard with its first ViewController using the code above. Next ViewController shows up without any problems, but what happened with the first storyboards ViewController? Is it still present in the stack or got it terminated or something like that?
I'm asking this because if I call
dismiss(animated: true, completion: nil)
in the first ViewController of the second storyboard, the ViewController disappears and the old one shows up again. Also if I call this while I want to present the second ViewController in my second storyboard within the first ViewController in my second storyboard, the first ViewController disappears too and presents the ViewController from the first storyboard.
In android, if I want to start the next Screen/Activity I do it with:
startActivity(new Intent(CurrentActivity.this, NextActivity.class));
finish(); //to drop the current activity
And while I'm inside the NextActivity and clicking the back button, the whole application will minimize.
I just want to make sure to not build up a huge stack of ViewControllers in my application.