---
title: main
framework: appkit
role: symbol
role_heading: Type Property
path: appkit/nsscreen/main
---

# main

Returns the screen object containing the window with the keyboard focus.

## Declaration

```swift
class var main: NSScreen? { get }
```

## Return Value

Return Value The main screen object.

## Discussion

Discussion The main screen is not necessarily the same screen that contains the menu bar or has its origin at (0, 0). The main screen refers to the screen containing the window that is currently receiving keyboard events. It is the main screen because it is the one with which the user is most likely interacting. The screen containing the menu bar is always the first object (index 0) in the array returned by the screens method.

## See Also

### Getting Screen Objects

- [deepest](appkit/nsscreen/deepest.md)
- [screens](appkit/nsscreen/screens.md)
