Reputation: 3428
I have a Xib file with a button. I want to segue to another view controller when the button is clicked. I've created a segue between the view controllers in StoryBoard and created an identifier, but can't seem to call it programatically.
@IBAction func buttonAction(sender: UIButton)
{
self.performSegueWithIdentifier("SegueToPostDetail", sender: sender)
}
Xcode error is "....has no member 'performSequeWithIdentifier'
Thanks!
Upvotes: 5
Views: 5924
Reputation: 286
You can't call performSegueWithIdentifier in a Xib class, only in a UIViewController class. So you have 2 solutions:
Upvotes: 5