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 (eg 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?
There are two ways to achieve this:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.