---
title: "order(_:relativeTo:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/order(_:relativeto:)"
---

# order(_:relativeTo:)

Repositions the window’s window device in the window server’s screen list.

## Declaration

```swift
func order(_ place: NSWindow.OrderingMode, relativeTo otherWin: Int)
```

## Parameters

- `place`: - doc://com.apple.appkit/documentation/AppKit/NSWindow/OrderingMode/out: The window is removed from the screen list and otherWin is ignored. doc://com.apple.appkit/documentation/AppKit/NSWindow/OrderingMode/above: The window is ordered immediately in front of the window whose window number is otherWin doc://com.apple.appkit/documentation/AppKit/NSWindow/OrderingMode/below: The window is placed immediately behind the window represented by otherWin.
- `otherWin`: The number of the window the window is to be placed in front of or behind. Pass 0 to place the window in front of (when place is NSWindowAbove) or behind (when place is NSWindowBelow) all other windows in its level.

## See Also

### Related Documentation

- [windowNumber](appkit/nswindow/windownumber.md)
- [makeKeyAndOrderFront(_:)](appkit/nswindow/makekeyandorderfront(_:).md)

### Managing Window Layers

- [orderOut(_:)](appkit/nswindow/orderout(_:).md)
- [orderBack(_:)](appkit/nswindow/orderback(_:).md)
- [orderFront(_:)](appkit/nswindow/orderfront(_:).md)
- [orderFrontRegardless()](appkit/nswindow/orderfrontregardless().md)
- [level](appkit/nswindow/level-swift.property.md)
- [NSWindow.Level](appkit/nswindow/level-swift.struct.md)
