A type you use to discover the app extensions available for your host app to use.
A host app uses this type to discover the app extensions that are ready for it to use.
This type provides both a static list of current extensions and a way for you to monitor
changes in app extension availability. You can use items from this list to instantiate an
``AppExtensionProcess`` type when you’re ready to run the app extension’s code.
Create a `Monitor` in your code and configure it with the extension points you want to
track. When you add an extension point to the monitor, the type adds the associated app
extensions to its ``AppExtensionPoint/Monitor/identities`` property. The property contains
only the app extensions that are available for your app to use, and doesn’t include
disabled or unapproved app extensions. The following example shows how to use the currently
available app extensions for one of the app’s defined extension points.
```
let someExtensionPoint = AppExtensionPoint.myExampleExtensionPoint
// Get a snapshot of available extensions.
let identitiesSnapshot = try await AppExtensionPoint.Monitor(someExtensionPoint).identities
```
The system manages the list of installed app extensions and updates that list when someone
installs or removes an app. The device owner must also approve any newly installed extensions
before apps can use them. While your app runs, you can observe the ``AppExtensionPoint/Monitor/identities``
property and respond to these changes asynchronously. The following code creates a task to
wait on changes to the list of identities:
```
let monitor = AppExtensionPoint.Monitor(appExtensionPoint:someExtensionPoint)
let identitiesUpdates = Observations { monitor.identities }
Task {
for await update in identitiesUpdates {
// Handle update.
}
}
```
To present a UI with the list of enabled and disabled app extensions, use the
<doc://com.apple.documentation/documentation/extensionkit/exappextensionbrowserviewcontroller> type.
final func addAppExtensionPoint(_ appExtensionPoint: AppExtensionPoint) async throws
Begins the tracking of app extensions that support the specified extension point.
- Parameters:
- appExtensionPoint: An extension point that you define in your host app. If the
monitor is already tracking the extension point, calling this method has no impact.
This method updates the state of the monitor, adding the specified extension point to
the list of those it’s tracking. If the new extension point has available app extensions,
this method updates the contents of the ``identities`` property. You can call this
method multiple times to track multiple extension points from your app.
Creates a new monitor and configures it with the specified extension point.
- Parameters:
- appExtensionPoint: An extension point type you defined in your host app.
Use this initializer to create a monitor and start looking for app extensions that match
the specified extension point. This initializer returns after successfully adding the
extension point to the monitor and generating the initial list of app extensions.
final func removeAppExtensionPoint(_ appExtensionPoint: AppExtensionPoint) async throws
Removes the specified extension point and stops tracking the associated app extensions.
- Parameters:
- appExtensionPoint: An extension point that you define in your host app. If the
monitor isn’t currently monitoring the extension point, calling this method has no impact.
This method updates the state of the monitor, removing the specified extension point from
the list of those it’s tracking. Removing an extension point causes the monitor to update
the ``identities`` property as needed.
get · iOS 26.0+
identities
TypeScript
get identities(): Array<AppExtensionIdentity>
Swift declaration
final var identities: [AppExtensionIdentity] { get }
The app extensions currently available to use with the monitored extension points.
Use this property to get an array of currently available app extensions your host app can use.
This array contains entries for all of the monitored extension points. To find out if
additional app extensions are present, but not yet enabled, get the value in the ``state`` property instead.
get · iOS 26.0+
state
TypeScript
get state(): AppExtensionPoint_Monitor_State
Swift declaration
final var state: AppExtensionPoint.Monitor.State { get }
The current details about the available, disabled, and unapproved extensions.
This property provides the list of available app extensions plus the number of currently disabled
and unapproved extensions. The property is observable, so you can monitor it for changes
while your app runs.
init · iOS 26.0+
init
TypeScript
static init(): AppExtensionPoint_Monitor
Swift declaration
init()
Creates a new monitor without any extension points.
After using this initializer, call the ``addAppExtensionPoint(_:)`` method to
add an extension point to monitor.