SceneLifecycleMonitor

public class SceneLifecycleMonitor : AppLifecycleMonitor

Implementation of AppLifecycleMonitor which takes both UIApplication and UIScene lifecycle.

Important

This is a Public Preview API. It may be changed or removed at any time.

Lifecycle

  • Declaration

    Swift

    public init(
        scene: UIScene? = nil,
        observationHandler: ObservableProtocol = ObservableHandler(dispatchQueue: .main)
    )

    Parameters

    scene

    An instance of UIScene to monitor states.

    observationHandler

    An implementation of observer pattern.

Public

  • Instance of UIScene which state is monitored by the SceneLifecycleMonitor

    Declaration

    Swift

    public weak var scene: UIScene?
  • Add observer.

    Declaration

    Swift

    public func addObserver(_ observer: AppUIInstanceStateObserver)

    Parameters

    observer

    observer of AppUIInstanceStateObserver

  • Remove observer.

    Declaration

    Swift

    public func removeObserver(_ observer: AppUIInstanceStateObserver)

    Parameters

    observer

    observer of AppUIInstanceStateObserver