---
title: "init(identifier:source:destination:performHandler:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsstoryboardsegue/init(identifier:source:destination:performhandler:)"
---

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

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

## Declaration

```swift
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 doc://com.apple.appkit/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 doc://com.apple.appkit/documentation/AppKit/NSStoryboardSegue/perform() method.

## Return Value

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

## Discussion

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

## See Also

### Customizing Storyboard Segue Initialization and Invocation

- [init(identifier:source:destination:)](appkit/nsstoryboardsegue/init(identifier:source:destination:).md)
- [perform()](appkit/nsstoryboardsegue/perform().md)
