<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSeguePerforming",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSSeguePerforming"
  },
  "title" : "NSSeguePerforming"
}
-->

# NSSeguePerforming

A set of methods that support the mediation of a custom segue.

```
protocol NSSeguePerforming : NSObjectProtocol
```

## Overview

When you subclass [`NSStoryboardSegue`](/documentation/AppKit/NSStoryboardSegue) to express a custom transition or containment relationship between storyboard scenes, you might also want to provide code that prepares the destination/contained view or window controller object. Put this code in an override of the [`prepare(for:sender:)`](/documentation/AppKit/NSSeguePerforming/prepare(for:sender:)) method.

To conditionally disallow the performance of a segue, override the [`shouldPerformSegue(withIdentifier:sender:)`](/documentation/AppKit/NSSeguePerforming/shouldPerformSegue(withIdentifier:sender:)) method, returning <doc://com.apple.documentation/documentation/Swift/false>.If you need to programmatically trigger a segue that cannot be expressed in a storyboard file, such as a transition between scenes in different storyboards, use the [`performSegue(withIdentifier:sender:)`](/documentation/AppKit/NSSeguePerforming/performSegue(withIdentifier:sender:)) method in this protocol.

## Topics

### Working with Storyboard Segues

[`performSegue(withIdentifier:sender:)`](/documentation/AppKit/NSSeguePerforming/performSegue(withIdentifier:sender:))

Performs the specified segue.

[`prepare(for:sender:)`](/documentation/AppKit/NSSeguePerforming/prepare(for:sender:))

Called when a segue is about to be performed.

[`shouldPerformSegue(withIdentifier:sender:)`](/documentation/AppKit/NSSeguePerforming/shouldPerformSegue(withIdentifier:sender:))

Called immediately prior to the performance of a storyboard 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)