---
title: "newWindowForTab(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsresponder/newwindowfortab(_:)"
---

# newWindowForTab(_:)

Creates a new window to show as a tab in a tabbed window.

## Declaration

```swift
@IBAction func newWindowForTab(_ sender: Any?)
```

## Parameters

- `sender`: The sender of the action.

## Discussion

Discussion The system automatically calls this method to create a window for a new tab when the user clicks the plus button in a tabbed window. The system shows a plus button on a tabbed window only if this method exists on one of the following objects: In an NSDocumentController subclass In the responder chain starting at NSWindow, such as NSWindow, the window delegate, the window controller, the NSApplication delegate, and so on
