<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSViewController/viewDidLoad()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSViewController(im)viewDidLoad"
  },
  "title" : "viewDidLoad()"
}
-->

# viewDidLoad()

Called after the view controller’s view has been loaded into memory.

```
func viewDidLoad()
```

## Discussion

You can override this method to perform tasks to immediately follow the setting of the [`view`](/documentation/AppKit/NSViewController/view) property.

Typically, your override would perform one-time instantiation and initialization of the contents of the view controller’s view. If you override this method, call this method on `super` at some point in your implementation in case a superclass also overrides this method.

For a view controller originating in a nib file, this method is called immediately after the [`view`](/documentation/AppKit/NSViewController/view) property is set. For a view controller created programmatically, this method is called immediately after the [`loadView()`](/documentation/AppKit/NSViewController/loadView()) method completes.

The default implementation of this method does nothing.

---

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)