---
title: willSelect()
framework: preferencepanes
role: symbol
role_heading: Instance Method
path: preferencepanes/nspreferencepane/willselect()
---

# willSelect()

Notifies the preference pane that the main app is about to display the preference pane’s main view.

## Declaration

```swift
func willSelect()
```

## Discussion

Discussion Default implementation does nothing. Override this method to perform actions right before the main view is displayed.

## See Also

### Selecting and Deselecting the Preference Pane

- [didSelect()](preferencepanes/nspreferencepane/didselect().md)
- [willUnselect()](preferencepanes/nspreferencepane/willunselect().md)
- [didUnselect()](preferencepanes/nspreferencepane/didunselect().md)
- [isSelected](preferencepanes/nspreferencepane/isselected.md)
- [shouldUnselect](preferencepanes/nspreferencepane/shouldunselect.md)
- [NSPreferencePaneUnselectReply](preferencepanes/nspreferencepaneunselectreply.md)
- [reply(toShouldUnselect:)](preferencepanes/nspreferencepane/reply(toshouldunselect:).md)
