init(_:)
Initializes a worker feature with a handler factory.
Declaration
init(_ handlerFactory: @escaping @Sendable () -> any AccessoryFeatureSessionHandler<AccessoryWorker.Session>)Parameters
- handlerFactory:
A closure that creates the handler for each session of the feature.
Discussion
Create the instance inside your data provider extension’s extensionPoint. The system calls the closure to create a new handler for each session. For more information, see Sending data to an accessory in the background.