---
title: "init(rootViewController:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uinavigationcontroller/init(rootviewcontroller:)"
---

# init(rootViewController:)

Initializes and returns a newly created navigation controller.

## Declaration

```swift
init(rootViewController: UIViewController)
```

## Parameters

- `rootViewController`: The view controller that resides at the bottom of the navigation stack. This object cannot be an instance of the doc://com.apple.uikit/documentation/UIKit/UITabBarController class.

## Return Value

Return Value The initialized navigation controller object or nil if there was a problem initializing the object.

## Discussion

Discussion This is a convenience method for initializing the receiver and pushing a root view controller onto the navigation stack. Every navigation stack must have at least one view controller to act as the root.

## See Also

### Creating a navigation controller

- [init(navigationBarClass:toolbarClass:)](uikit/uinavigationcontroller/init(navigationbarclass:toolbarclass:).md)
- [init(nibName:bundle:)](uikit/uinavigationcontroller/init(nibname:bundle:).md)
- [init(coder:)](uikit/uinavigationcontroller/init(coder:).md)
