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

# loadView()

Creates the view that the controller manages.

```
func loadView()
```

## Discussion

You should never call this method directly. The view controller calls this method when its [`view`](/documentation/UIKit/UIViewController/view) property is requested but is currently `nil`. This method loads or creates a view and assigns it to the [`view`](/documentation/UIKit/UIViewController/view) property.

If the view controller has an associated nib file, this method loads the view from the nib file. A view controller has an associated nib file if the [`nibName`](/documentation/UIKit/UIViewController/nibName) property returns a non-`nil` value, which occurs if the view controller was instantiated from a storyboard, if you explicitly assigned it a nib file using the [`init(nibName:bundle:)`](/documentation/UIKit/UIViewController/init(nibName:bundle:)) method, or if iOS finds a nib file in the app bundle with a name based on the view controller’s class name. If the view controller does not have an associated nib file, this method creates a plain [`UIView`](/documentation/UIKit/UIView) object instead.

If you use Interface Builder to create your views and initialize the view controller, you must not override this method.

You can override this method in order to create your views manually. If you choose to do so, assign the root view of your view hierarchy to the [`view`](/documentation/UIKit/UIViewController/view) property. The views you create should be unique instances and should not be shared with any other view controller object. Your custom implementation of this method should not call `super`.

If you want to perform any additional initialization of your views, do so in the [`viewDidLoad()`](/documentation/UIKit/UIViewController/viewDidLoad()) method.

## See Also

[`nibName`](/documentation/UIKit/UIViewController/nibName)

The name of the view controller’s nib file, if one was specified.



---

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)