<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UINib",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UINib"
  },
  "title" : "UINib"
}
-->

# UINib

An object that contains Interface Builder nib files.

```
@MainActor class UINib
```

## Overview

A [`UINib`](/documentation/UIKit/UINib) object caches the contents of a nib file in memory, ready for unarchiving and instantiation. When your app needs to instantiate the contents of the nib file, it can do so without having to load the data from the nib file first, which improves performance. The [`UINib`](/documentation/UIKit/UINib) object can automatically release this cached nib data to free up memory for your app under low-memory conditions, reloading that data the next time your app instantiates the nib.

Your app should use [`UINib`](/documentation/UIKit/UINib) objects whenever it needs to repeatedly instantiate the same nib data. For example, if your table view uses a nib file to instantiate table view cells, caching the nib in a [`UINib`](/documentation/UIKit/UINib) object can improve performance.

When you create a [`UINib`](/documentation/UIKit/UINib) object using the contents of a nib file, the object loads the object graph in the referenced nib file, but it doesn’t unarchive it yet. To unarchive all of the nib data and instantiate the nib, your app calls the [`instantiate(withOwner:options:)`](/documentation/UIKit/UINib/instantiate(withOwner:options:)) method. For more information about the steps that the [`UINib`](/documentation/UIKit/UINib) object follows to instantiate the nib’s object graph, see [Resource Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Introduction/Introduction.html#//apple_ref/doc/uid/10000051i).

## Topics

### Creating a nib object

[`init(nibName:bundle:)`](/documentation/UIKit/UINib/init(nibName:bundle:))

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

[`init(data:bundle:)`](/documentation/UIKit/UINib/init(data:bundle:))

Creates a nib object from nib data stored in memory.

### Retrieving objects from the nib file

[`instantiate(withOwner:options:)`](/documentation/UIKit/UINib/instantiate(withOwner:options:))

Unarchives and instantiates the in-memory contents of the nib object’s nib file, creating a distinct object tree and set of top-level objects.

[`UINib.OptionsKey`](/documentation/UIKit/UINib/OptionsKey)

Options that specify how to unarchive and instantiate the nib.

### Deprecated

[`UINibProxiedObjectsKey`](/documentation/UIKit/UINibProxiedObjectsKey)

The runtime replacement objects for any proxy objects in the nib file.



---

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)