ExtensionHostMonitor

public class ExtensionHostMonitor : BaseNotificationMonitor

An ExtensionHostMonitor instance monitors an extension context for changes to the runtime state of the extension’s host app.

  • Encapsulates changes to the runtime state of the extension’s host app.

    See more

    Declaration

    Swift

    public enum Event
  • Specifies which events to monitor.

    See more

    Declaration

    Swift

    public struct Options : OptionSet
  • Initializes a new ExtensionHostMonitor.

    Declaration

    Swift

    public init(context: NSExtensionContext,
                options: Options = .all,
                queue: OperationQueue = .main,
                handler: @escaping (Event) -> Void)

    Parameters

    context

    The extension context to monitor.

    options

    The options that specify which events to monitor. By default, all events are monitored.

    queue

    The operation queue on which the handler executes. By default, the main operation queue is used.

    handler

    The handler to call when the runtime state of the extension’s host app changes.

  • The extension context being monitored.

    Declaration

    Swift

    public let context: NSExtensionContext
  • Declaration

    Swift

    override public func addNotificationObservers()