<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIStoryboardSegue/init(identifier:source:destination:performHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIStoryboardSegue(cm)segueWithIdentifier:source:destination:performHandler:"
  },
  "title" : "init(identifier:source:destination:performHandler:)"
}
-->

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

Creates a segue that calls a block to perform the segue transition.

```
convenience init(identifier: String?, source: UIViewController, destination: UIViewController, performHandler: @escaping () -> Void)
```

## Parameters

`identifier`

The identifier you want to associate with this particular instance of the segue. You can use this identifier to differentiate one type of segue from another at runtime.

`source`

The view controller visible at the start of the segue.

`destination`

The view controller to display after the completion of the segue.

`performHandler`

A block to be called when the segue’s [`perform()`](/documentation/UIKit/UIStoryboardSegue/perform()) method is called.

## Return Value

An initialized segue object.

## Discussion

You use this method as an alternative to creating a subclass. Your perform handler should do all of the work necessary to transition between the source and destination view controllers, exactly as if you were implementing the [`perform()`](/documentation/UIKit/UIStoryboardSegue/perform()) method.

## See Also

[`perform()`](/documentation/UIKit/UIStoryboardSegue/perform())

Performs the visual transition for the 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)