---
title: "getHostApplication(completionHandler:)"
framework: safariservices
role: symbol
role_heading: Type Method
path: "safariservices/sfsafariapplication/gethostapplication(completionhandler:)"
---

# getHostApplication(completionHandler:)

## Declaration

```swift
class func getHostApplication(completionHandler: @escaping @Sendable (NSRunningApplication) -> Void)
```

```swift
class func hostApplication() async -> NSRunningApplication
```

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

## See Also

### Type Methods

- [getAllWindows(completionHandler:)](safariservices/sfsafariapplication/getallwindows(completionhandler:).md)
