---
title: windowNumber
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nswindow/windownumber
---

# windowNumber

The window number of the window’s window device.

## Declaration

```swift
var windowNumber: Int { get }
```

## Discussion

Discussion Each window device in an application is given a unique window number—note that this isn’t the same as the global window number assigned by the window server. This number can be used to identify the window device with the order(_:relativeTo:) method and in the AppKit function NSWindowList. If the window doesn’t have a window device, the value of this property is equal to or less than 0.

## See Also

### Related Documentation

- [isOneShot](appkit/nswindow/isoneshot.md)
- [init(contentRect:styleMask:backing:defer:)](appkit/nswindow/init(contentrect:stylemask:backing:defer:).md)

### Accessing Window Information

- [depthLimit](appkit/nswindow/depthlimit.md)
- [hasDynamicDepthLimit](appkit/nswindow/hasdynamicdepthlimit.md)
- [defaultDepthLimit](appkit/nswindow/defaultdepthlimit.md)
- [windowNumbers(options:)](appkit/nswindow/windownumbers(options:).md)
- [deviceDescription](appkit/nswindow/devicedescription.md)
- [NSDeviceDescriptionKey](appkit/nsdevicedescriptionkey.md)
- [canBecomeVisibleWithoutLogin](appkit/nswindow/canbecomevisiblewithoutlogin.md)
- [sharingType](appkit/nswindow/sharingtype-swift.property.md)
- [backingType](appkit/nswindow/backingtype.md)
- [displayLink(target:selector:)](appkit/nswindow/displaylink(target:selector:).md)
