Reputation: 654
I'm getting an error:
has no segue with identifier 'dest1''
and what I did was:
set storyboard ids to "dest1" and "dest2"
@IBAction func Parameters(_ sender: AnyObject) {
self.performSegue(withIdentifier: "dest1", sender: nil)
}
Prepare for segue
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
print("0")
if segue.identifier == "dest1" {
if let svc = segue.destination as? secondViewController {
print("1")
}
} else if segue.identifier == "dest2" {
if let svc = segue.destination as? reverbViewController {
print("2")
}
}
What am I missing?
Upvotes: 1
Views: 2638
Reputation: 9044
From your description, you have set storyboard ids to "dest1" and "dest2", whereas you need to set segue identifiers. Click on the segue itself in IB, and set it's property.
Storyboard identifiers are used when creating the view controller using code...
instantiateViewControllerWithIdentifier("myViewController")
Upvotes: 2