---
title: "instantiateViewController(withIdentifier:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uistoryboard/instantiateviewcontroller(withidentifier:)"
---

# instantiateViewController(withIdentifier:)

Creates the view controller with the specified identifier and initializes it with the data from the storyboard.

## Declaration

```swift
func instantiateViewController(withIdentifier identifier: String) -> UIViewController
```

## Parameters

- `identifier`: An identifier string that uniquely identifies the view controller in the storyboard file. At design time, put this same string in the Storyboard ID attribute of your view controller in Interface Builder. This identifier is not a property of the view controller object itself. The storyboard uses it to locate the appropriate data for your view controller. If the specified identifier does not exist in the storyboard file, this method raises an exception.

## Return Value

Return Value The view controller corresponding to the specified identifier string. If no view controller has the given identifier, this method throws an exception.

## Discussion

Discussion Use this method to create a view controller object to present programmatically. Each time you call this method, it creates a new instance of the view controller using the init(coder:) method.

## See Also

### Instantiating Storyboard View Controllers

- [instantiateViewController(identifier:creator:)](uikit/uistoryboard/instantiateviewcontroller(identifier:creator:).md)
