Trigger Segue Programmatically

suggest change

PerformSegueWithIdentifier:

func performSegueWithIdentifier(identifier: String, sender: AnyObject?)

Initiates the segue with the specified identifier from the current view controller's storyboard file

Parameters

Identifier: String that identifies the triggered segue

Sender: The object that will initiate the segue.

Example in Swift

Performing a segue with identifier “SomeSpecificIdentifier” from a table view row selection:

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    performSegueWithIdentifier("SomeSpecificIdentifier", sender: indexPath.item)
}

indexPath.item is the same value as row on NSIndexPath. item is the name collection views use. The call is Swift 2.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents