---
title: mainViewDidLoad()
framework: preferencepanes
role: symbol
role_heading: Instance Method
path: preferencepanes/nspreferencepane/mainviewdidload()
---

# mainViewDidLoad()

Notifies the preference pane that the main view is set up and prepared to be displayed.

## Declaration

```swift
func mainViewDidLoad()
```

## Discussion

Discussion Invoked by the default implementation of loadMainView() after the main nib file has been loaded and the main view of the preference pane has been set. The default implementation does nothing. Override this method to initialize the main view with the current preference settings.

## See Also

### Loading the Main View

- [loadMainView()](preferencepanes/nspreferencepane/loadmainview().md)
- [assignMainView()](preferencepanes/nspreferencepane/assignmainview().md)
