AppExtensionProcess
A type the host app creates to launch and manage an app extension.
Declaration
struct AppExtensionProcessMentioned in
Overview
Create this type from your host app when you want to communicate with an available app extension. This type creates a new process, and runs the app extension’s startup code in that process. After startup, establish an XPC connection to the app extension’s process using the methods of this type. Use that XPC connection to communicate with the app extension.
When creating an instance of this type, you specify which app extension to launch using an AppExtensionIdentity type. If the app extension is already running, creating the AppExtensionProcess type configures it with the already running process. If the app extension isn’t yet running, creating this type forks a new process and runs the app extension’s startup code in it. In both cases, you receive an instance of this structure only after the app extension is running and ready for you to establish an XPC connection.
Maintain a reference to this structure for as long as you need to communicate with the app extension. When you no longer need the app extension, call the invalidate method to release your app’s reference to the process. If the app extension process exits for any reason, the system calls the onInterruption handler you provided at configuration time.