---
title: "hostViewControllerDidActivate(_:)"
framework: extensionkit
role: symbol
role_heading: Instance Method
path: "extensionkit/exhostviewcontrollerdelegate/hostviewcontrollerdidactivate(_:)"
---

# hostViewControllerDidActivate(_:)

Tells the host that the app extension is active and ready to accept an XPC connection.

## Declaration

```swift
@MainActor optional func hostViewControllerDidActivate(_ viewController: EXHostViewController)
```

## Parameters

- `viewController`: The host view controller that initiated the connection.

## Mentioned in

Including extension-based UI in your interface

## Discussion

Discussion The host view controller calls this method after it launches an app extension and connects to its remote scene. Use this method to establish an XPC connection to the newly created UI instance.

## See Also

### Responding to activation and deactivation events

- [hostViewControllerWillDeactivate(_:error:)](extensionkit/exhostviewcontrollerdelegate/hostviewcontrollerwilldeactivate(_:error:).md)
