Swift development tutorial-use Storyboard for interface jump, swiftstoryboard
Using storyboard with code can indeed bring a lot of convenience for development.
In practice, we often encounter page Jump problems. You can create a "connection" through the control and interface.
If it is a jump to navigationcontroller, select the push method (otherwise, an error will be reported when xcode is running );
If it is a jump to Viewcontroller, select modal mode.
If you want to open another interface through code, you need to set the seue. identifier for the connection between them. For example, you need to set it to jumpid.
Then the code can be written as follows:
Self. inclumseguewithidentifier ("jumpid", sender: self );
If you want to pass a value during the jump, you can write as follows:
Override func prepareForSegue (segue: UIStoryboardSegue, sender: AnyObject ?) {
If (segue. identifier = "jumpid "){
Var barInfo: BarInfoViewController = segue. destinationViewControlleras! BarInfoViewController;
BarInfo. name = "david ";
BarInfo. age = 99;
}
}
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.