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

# NSStoryboard

An encapsulation of the design-time view controller and window controller graph represented in an Interface Builder storyboard resource file.

```
class NSStoryboard
```

## Overview

You can use storyboard files to define the view and window controllers for all or part of an app’s user interface. Typically, AppKit creates these objects automatically in response to actions defined within a storyboard file itself, such as the clicking of a button or the choosing of a menu item. However, you can use a storyboard object to directly instantiate the initial view controller from a storyboard file or to instantiate other view or window controllers that you want to present programmatically. In the context of a storyboard file, each contained controller is called a *scene*.

A transition from one scene to another in a storyboard is called a *segue*. This same term, and the same Cocoa APIs, express a containment relationship between two scenes. In macOS, containment (rather than transition) is the more common notion for storyboards. For descriptions of the related APIs, refer to [`NSStoryboardSegue`](/documentation/AppKit/NSStoryboardSegue) and [`NSSeguePerforming`](/documentation/AppKit/NSSeguePerforming).

## Topics

### Creating a Storyboard Object

[`init(name:bundle:)`](/documentation/AppKit/NSStoryboard/init(name:bundle:))

Creates a storyboard based on the named storyboard file in the specified bundle.

[`main`](/documentation/AppKit/NSStoryboard/main)

The app’s main storyboard.

[`NSStoryboard.Name`](/documentation/AppKit/NSStoryboard/Name)

The name of the storyboard file.

### Loading the Initial View Controller

[`instantiateInitialController()`](/documentation/AppKit/NSStoryboard/instantiateInitialController())

Creates the initial view controller or window controller from a storyboard.

[`instantiateInitialController(creator:)`](/documentation/AppKit/NSStoryboard/instantiateInitialController(creator:)-pi04)

Creates the initial view controller from the storyboard and initializes it using your custom code.

[`instantiateInitialController(creator:)`](/documentation/AppKit/NSStoryboard/instantiateInitialController(creator:)-529r1)

Creates the initial window controller from the storyboard and initializes it using your custom code.

### Instantiating Storyboard Controllers

[`instantiateController(withIdentifier:)`](/documentation/AppKit/NSStoryboard/instantiateController(withIdentifier:))

Instantiates a specified view controller or window controller from a storyboard.

[`instantiateController(identifier:creator:)`](/documentation/AppKit/NSStoryboard/instantiateController(identifier:creator:)-7ddcf)

Creates the specified view controller from the storyboard and initializes it using your custom initialization code.

[`instantiateController(identifier:creator:)`](/documentation/AppKit/NSStoryboard/instantiateController(identifier:creator:)-50rw3)

Creates the specified window controller from the storyboard and initializes it using your custom initialization code.

[`NSStoryboardControllerCreator`](/documentation/AppKit/NSStoryboardControllerCreator)

A block that you use to handle the custom creation of controller objects from your storyboard file.

[`NSStoryboard.SceneIdentifier`](/documentation/AppKit/NSStoryboard/SceneIdentifier)

A string that uniquely identifies a view controller or window controller in your storyboard file.

### Instance Methods

[`instantiateControllerWithIdentifier:creator:`](/documentation/AppKit/NSStoryboard/instantiateControllerWithIdentifier:creator:)

[`instantiateInitialControllerWithCreator:`](/documentation/AppKit/NSStoryboard/instantiateInitialControllerWithCreator:)



---

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)