---
title: "getContainingTab(completionHandler:)"
framework: safariservices
role: symbol
role_heading: Instance Method
path: "safariservices/sfsafaripage/getcontainingtab(completionhandler:)"
---

# getContainingTab(completionHandler:)

## Declaration

```swift
func getContainingTab(completionHandler: @escaping @Sendable (SFSafariTab) -> Void)
```

```swift
func containingTab() async -> SFSafariTab
```

## 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 containingTab() async -> SFSafariTab For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously.

## See Also

### Instance Methods

- [getScreenshotOfVisibleArea(completionHandler:)](safariservices/sfsafaripage/getscreenshotofvisiblearea(completionhandler:).md)
