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

# NSStoryboardSegue

A transition or containment relationship between two scenes in a storyboard.

```
class NSStoryboardSegue
```

## Overview

In this context, a *scene* is a view controller or a window controller and a *storyboard* is an instance of the [`NSStoryboard`](/documentation/AppKit/NSStoryboard) class.

A storyboard segue has a procedural notion of being invoked, known in the API as being *performed*. You can take advantage of hooks into the segue performance process by way of the [`NSSeguePerforming`](/documentation/AppKit/NSSeguePerforming) protocol.

You do not create storyboard segue objects directly. Instead, the system creates them as needed as segues are invoked. To run code during initialization and performance of a segue, override the [`init(identifier:source:destination:)`](/documentation/AppKit/NSStoryboardSegue/init(identifier:source:destination:)) and [`perform()`](/documentation/AppKit/NSStoryboardSegue/perform()) methods.

You can initiate a segue programmatically with the [`performSegue(withIdentifier:sender:)`](/documentation/AppKit/NSSeguePerforming/performSegue(withIdentifier:sender:)) method of the [`NSSeguePerforming`](/documentation/AppKit/NSSeguePerforming) protocol. For example, you might do this to transition from a scene in one storyboard file to a scene in another.

## Topics

### Inspecting a Storyboard Segue

[`sourceController`](/documentation/AppKit/NSStoryboardSegue/sourceController)

The starting/containing view controller or window controller for the storyboard segue.

[`destinationController`](/documentation/AppKit/NSStoryboardSegue/destinationController)

The ending/contained view controller or window controller for the storyboard segue.

[`identifier`](/documentation/AppKit/NSStoryboardSegue/identifier-swift.property)

An optional, unique identifier for the storyboard segue that you can specify using the Identity inspector in Interface Builder.

[`Identifier`](/documentation/AppKit/NSStoryboardSegue/Identifier-swift.typealias)

### Customizing Storyboard Segue Initialization and Invocation

[`+  segueWithIdentifier:source:destination:performHandler:`](/documentation/AppKit/NSStoryboardSegue/init(identifier:source:destination:performHandler:))

Creates a storyboard segue and a block used when the segue is performed.

[`-  initWithIdentifier:source:destination:`](/documentation/AppKit/NSStoryboardSegue/init(identifier:source:destination:))

The designated initializer for a storyboard segue.

[`-  perform`](/documentation/AppKit/NSStoryboardSegue/perform())

Performs a visual transition from one controller to another.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)