How do I create two segues for a single button?

Updated on November 24, 2017 in Swift 3
3 on March 15, 2017

I would like to create two segues (to go to two different view controllers) with just one button based on the root view controller. Can anyone help me? Thank you.

  • Liked by
2 on March 16, 2017

Hi, all you would need to do is perform the segues programatically. Within your code, have an if statement that check if a certain condition is met. If it is, perform the one segue. If it isn’t, perform the other one:)

on November 22, 2017

How would you create two segues for one button?

When I try to do that it only does one view and not the other?

on November 24, 2017


You easily have to click on the ViewController where your Button is located. On top you’ll find three round Buttons named: “ViewController”, “First Responder” & “Exit”. Connect the “ViewController” Button with the two following ViewControllers where you want your own (custom) Button to go to. Then you simply name the two Segue’s (give them two different identifiers) and then you use an if-statement to check which segue your button has to use (with the identifiers you have set).

Show more replies
  • Liked by
Loading more replies