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

# init(identifier:source:destination:)

The designated initializer for a storyboard segue.

```
init(identifier: NSStoryboardSegue.Identifier, source sourceController: Any, destination destinationController: Any)
```

## Parameters

`identifier`

The unique identifier for the storyboard segue. See the [`identifier`](/documentation/AppKit/NSStoryboardSegue/identifier-swift.property) property.

`sourceController`

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

`destinationController`

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

## Return Value

An initialized storyboard segue, ready to be performed.

## Discussion

When a segue begins, the system calls this method. To run code during segue initialization, implement a storyboard segue subclass and override this method.

Whenever this method is called, the system then calls the [`perform()`](/documentation/AppKit/NSStoryboardSegue/perform()) method.

---

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)