---
title: "transferWindowSharing(to:completionHandler:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/transferwindowsharing(to:completionhandler:)"
---

# transferWindowSharing(to:completionHandler:)

Attempts to move window sharing (within a SharePlay session) from this window to another window.

## Declaration

```swift
func transferWindowSharing(to window: NSWindow, completionHandler: @escaping ((any Error)?) -> Void)
```

```swift
func transferWindowSharing(to window: NSWindow) async throws
```

## Parameters

- `window`: Another window to replace this window in representing the user’s current activity.
- `completionHandler`: A completion block that is called after the request finishes.

## Discussion

Discussion In response to this request, the user may choose to transfer sharing to the new window, or simply stop sharing the content.

## See Also

### Managing Window Sharing

- [hasActiveWindowSharingSession](appkit/nswindow/hasactivewindowsharingsession.md)
