---
title: "init(nibName:bundle:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uinib/init(nibname:bundle:)"
---

# init(nibName:bundle:)

Returns a nib object from the nib file in the specified bundle.

## Declaration

```swift
init(nibName name: String, bundle bundleOrNil: Bundle?)
```

## Parameters

- `name`: The name of the nib file, without any leading path information.
- `bundleOrNil`: The bundle in which to search for the nib file. If you specify nil, this method looks for the nib file in the main bundle.

## Return Value

Return Value The initialized UINib object. An exception is thrown if there were errors during initialization or the nib file could not be located.

## Discussion

Discussion The UINib object looks for the nib file in the bundle’s language-specific project directories first, followed by the Resources directory.

## See Also

### Creating a nib object

- [init(data:bundle:)](uikit/uinib/init(data:bundle:).md)
