---
title: "getContainingWindow(completionHandler:)"
framework: safariservices
role: symbol
role_heading: Instance Method
path: "safariservices/sfsafaritab/getcontainingwindow(completionhandler:)"
---

# getContainingWindow(completionHandler:)

## Declaration

```swift
func getContainingWindow(completionHandler: @escaping @Sendable (SFSafariWindow?) -> Void)
```

```swift
func containingWindow() async -> SFSafariWindow?
```

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func containingWindow() async -> SFSafariWindow? For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously.

## See Also

### Instance Methods

- [close()](safariservices/sfsafaritab/close().md)
- [navigate(to:)](safariservices/sfsafaritab/navigate(to:).md)
