This code will be really useful to you to change the view controller using Storyboard ID.
For example -
There were 2 view Controllers named FirstViewController and SecondViewController respectively.
If you want to move from FirstViewController to SecondViewController there is a simple Code using Storyboard ID.
Step 1 :-
Enter the StoryBoard ID for both the ViewControllers
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSDOnSq2YEQ3ue1UwRnNCbn-U0rAnOaiO4Du63aZ4EV8kRgCZOIOHf2f4iBdz2YzGj0Fwz_q9ANCcQ_Qr_nmim39SlgQ5giUWzWNNRTkx-YRoelXbGPOJ1j0Bfh83NtmvCFABBvIds45VE/s200/Screen+Shot+2016-08-02+at+9.39.26+AM.png)
Step 2 :-
Write a code in FirstViewController.
For example -
There were 2 view Controllers named FirstViewController and SecondViewController respectively.
If you want to move from FirstViewController to SecondViewController there is a simple Code using Storyboard ID.
Step 1 :-
Enter the StoryBoard ID for both the ViewControllers
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSDOnSq2YEQ3ue1UwRnNCbn-U0rAnOaiO4Du63aZ4EV8kRgCZOIOHf2f4iBdz2YzGj0Fwz_q9ANCcQ_Qr_nmim39SlgQ5giUWzWNNRTkx-YRoelXbGPOJ1j0Bfh83NtmvCFABBvIds45VE/s200/Screen+Shot+2016-08-02+at+9.39.26+AM.png)
Step 2 :-
Write a code in FirstViewController.
//to navigate to the next view controller with the help of storyboard let secondVC = self.storyboard?.instantiateViewControllerWithIdentifier("SecondViewController") as! SecondViewController self.navigationController?.pushViewController(secondVC, animated: true)
No comments:
Post a Comment