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

# init(identifier:source:destination:performHandler:)

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

```
convenience init(identifier: NSStoryboardSegue.Identifier, source sourceController: Any, destination destinationController: Any, performHandler: @escaping () -> Void)
```

## 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.

`performHandler`

A block of code that you provide, to be run each time the system calls the [`perform()`](/documentation/AppKit/NSStoryboardSegue/perform()) method.

## Return Value

An initialized storyboard segue and code block, ready to be performed.

## Discussion

You can use this method to customize a storyboard segue in lieu of creating a subclass.

---

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)