Reputation: 197
I really love the graphical interface of the storyboard designer in Xcode, because all the segues are
displayed with an arrow.
But sometimes, when there is more complexity (e.g. variable to pass), I have to use a programatic way to switch to another ViewController.
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
let nextViewController = storyBoard.instantiateViewController(withIdentifier: "HomeViewController") as! HomeViewController
// pass variable
nextViewController.email = self.textfieldEmail.text!
self.present(nextViewController, animated:true, completion:nil)
I dislike, that some of the segues in my App are displayed with an arrow in storyboard, while the more complex ones are not. Is there any way to show those more complex segues with an arrow in the Main.storyboard?
Upvotes: 0
Views: 292
Reputation: 2874
There are two ways to achieve this:
Upvotes: 1