Contents

init(configuration:)

Finds an existing process for the specified app extension or creates a new one synchronously.

Declaration

init(configuration: AppExtensionProcess.Configuration) throws

Parameters

  • configuration:

    A type that contains the identity of the app extension and additional configuration details. The initializer copies the information it needs from your configuration structure and doesn’t maintain a reference to it.

Discussion

Use this initializer to request a process for the specified app extension and wait for the results. If a process for the extension already exists, the returned type uses that process. If no process exists, the system creates one and runs the app extension’s startup code before returning.

After receiving an instance of this type, use its methods to configure an XPC connection to the app extension. The system gives the app extension’s process enough runtime for your app to establish a connection. If you don’t create a connection right away, the system eventually suspends the app extension’s process. The system resumes the process again if you later try to create an XPC connection to it.

See Also

Creating the app-extension process