ApplicationStateMonitor

public class ApplicationStateMonitor: BaseNotificationMonitor

An ApplicationStateMonitor instance monitors the app for changes to its runtime state.

  • Encapsulates changes to the runtime state of the app.

    See more

    Declaration

    Swift

    public enum Event
  • Specifies which events to monitor.

    See more

    Declaration

    Swift

    public struct Options: OptionSet
  • Initializes a new ApplicationStateMonitor.

    Declaration

    Swift

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

    Parameters

    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 app changes its runtime state or is about to change its runtime state.

  • The runtime state of the app.

    Declaration

    Swift

    public var state: UIApplicationState
  • Declaration

    Swift

    override public func addNotificationObservers()