<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSeguePerforming/performSegue(withIdentifier:sender:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSSeguePerforming(im)performSegueWithIdentifier:sender:"
  },
  "title" : "performSegue(withIdentifier:sender:)"
}
-->

# performSegue(withIdentifier:sender:)

Performs the specified segue.

```
@MainActor optional func performSegue(withIdentifier identifier: NSStoryboardSegue.Identifier, sender: Any?)
```

## Parameters

`identifier`

The string that uniquely identifies the segue in the storyboard file.

    In Interface Builder, you can provide an identifier string to a segue using the inspector. Pass this string to this parameter.
  
  > Note:
  > This method throws an [Exception handling](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/ExceptionHandling.html#//apple_ref/doc/uid/TP40008195-CH18) if there is no segue with the specified identifier or if the identifier is `nil`.

`sender`

The object that you want to use to initiate the segue. This parameter makes the object available to your implementation during the segue.

## Discussion

Apps typically do not need to trigger segues programmatically. If needed, you can call this method to trigger a segue for an action that cannot be expressed in a storyboard file, such as a transition between scenes in different storyboards.

Typically, a segue is triggered by a user action, such as clicking a button. In Interface Builder, configure an object, such as a control embedded in the view controller’s view hierarchy, to trigger the segue.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)