UIApplication

extension UIApplication: MoEngageUIApplication

Extension making UIApplication conform to MoEngageUIApplication.

This extension enables the real UIApplication to be used interchangeably with mock implementations through the protocol abstraction.

  • Implements delegate change observation for UIApplication.

    This method wraps the standard KVO API to provide a simpler interface for observing delegate changes.

    Declaration

    Swift

    @MainActor
    public func observeDelegateChanges(
        changeHandler: @escaping (
            _ oldDelegate: UIApplicationDelegate?,
            _ newDelegate: UIApplicationDelegate?
        ) -> Void
    ) -> NSKeyValueObservation

    Parameters

    changeHandler

    Called when the delegate property changes.

    Return Value

    The KVO observation object.