Using segue to switch back and forth between Viewcontroller, here's how to switch:
1. Switch using the Click button
Directly, in the View property interface that needs to be switched, click Modal and then pull to the previous view screen or button
2. Manually jump
If you pull the button on the Touchupinside, then click on the left button will be cut to the right view, assuming pull to the view, will connect manual, in the code to implement the jump
Set the Indentifier property of the segue:
To manually jump in the code:
Add trigger segue in Viewdidappear to make your own active jump-(void) Viewdidappear: (BOOL) animated{ [self performseguewithidentifier:@] Drawecg "Sender:self";}
Note: The viewdidload implementation of the jump is invalid
3. How to jump to a random page
Add the following code to the name of the function in the Viewcontroller file where it is possible to perform a superior jump:
#pragma mark defines this function, the other viewcontroller can jump right out of the exit-(Ibaction) GoHome: (Uistoryboardsegue *) segue{ [[Segue Sourceviewcontroller] class];}
Right-click on exit to jump to view, select the GoHome function, pull to the button you want to run, you can jump
The code implementation can also return to the previous page and log off the current page:
-(void) lastpage{ NSLog (@ "clicked on the previous View button"); [Self Dismissviewcontrolleranimated:yes completion:^ (void) { //Code }];}
This can also be achieved:
Get storyboard Uistoryboard *board = [Uistoryboard storyboardwithname:@ "Mainstoryboard" bundle:nil]; Get a view uiviewcontroller *next = [Board instantiateviewcontrollerwithidentifier:@ "Second"] in the storyboard;//Jump [ Self Presentmodalviewcontroller:next animated:yes];
Of course, assuming that you use the navigation Controller to connect using push, it is not the code above that jumps:
Jump to Landscapeviewcontroller
Open a horizontal screen interface-(ibaction) Openlandscapecontrol: (ID) Sender { Landscapeviewcontroller *control = [[ Landscapeviewcontroller alloc]initwithnibname:@ "Landscapeviewcontroller" bundle:nil]; [Self.navigationcontroller Pushviewcontroller:control animated:yes];}
Use Pop to return to the previous view
Return to previous page-(ibaction) Clickback: (ID) Sender { [Self.navigationcontroller poptorootviewcontrolleranimated:yes];}