The Segue identifier is not the same as the storyboard identifier, the storyboard identifier used when you want to create a viewController based on this particular storyboard - and it must be unique, unlike the segue identifier -.
If you already know how to create a segue, you can skip this part.
Adding a segue between two viewControllers:
In the interface builder, press ctrl and drag between the two view managers you want to link. You should see:

Select Show -for example-, the output should look like this:

The arrow surrounded by the red rectangle is segue.
addtional note: if you selected "show", you have your first viewController built in to the navigationController (select your first viewController -> Editor -> Embed In -> Navigation Controller), the result should look like this:

Identifier assignment for a segment:
Select segue, from the attribute inspector you will see the "Identifier" text box so that it! be sure to insert the same name as in performSegueWithIdentifier .
If you do not know where to find the attribute inspector, it is in the upper right form:

AND
To add several segues from one viewController to many, perform the same process (ctrl + drag from the first controller to another viewController), the output should look like this:

In this case, you may run into the problem of how to recognize which session was performed, overriding the prepareForSegue method is a solution, you can do a check based on the segue identifier:
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) { if (segue.identifier == "firstSegueIdentifier") { // ... } else if (segue.identifier == "secondSegueIdentifier") { //... } }
Ahmad f
source share