OpenURLMonitor

@MainActor
public final class OpenURLMonitor : NSObject

A singleton that publishes all URLs your app is asked to open.

  • Shared singleton instance

    Declaration

    Swift

    @MainActor
    public static let shared: OpenURLMonitor
  • Any subscriber can listen to this to be notified of incoming URLs

    Declaration

    Swift

    @MainActor
    public let urlPublisher: PassthroughSubject<URL, Never>
  • Call this from your AppDelegate/SceneDelegate when the app is asked to open a URL.

    Declaration

    Swift

    @discardableResult
    @MainActor
    public func handleOpenURL(_ url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool

    Return Value

    You can return the Bool back to the system if you want.