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

# getActivePage(completionHandler:)

Calls the completion handler passing the active page in the tab.

## Declaration

```swift
func getActivePage(completionHandler: @escaping @Sendable (SFSafariPage?) -> Void)
```

```swift
func activePage() async -> SFSafariPage?
```

## Parameters

- `completionHandler`: A block to call when the active page is retrieved.

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

## See Also

### Accessing Pages

- [getPagesWithCompletionHandler(_:)](safariservices/sfsafaritab/getpageswithcompletionhandler(_:).md)
