RootViewProvider

public protocol RootViewProvider

Type that is responsible for providing root view in current view hierarchy.

Note

on iOS and tvOS, commonly, the root provider is UIWindow via UIApplication.shared.keyWindow, however there are scenarios where keyWindow might not be accessible, for example in iMesssage apps and application extensions. In those cases you can use root view controller that is accessible in those context, for example in iMessage extensions this could be MSMessagesAppViewController, or view controller presented on top of it. Also, your app might have several UIWindow objects working in the same time, for example when app is using AirPlay, or if UIWindows are used to present different interfaces modally. In those cases it’s recommended to have multiple Router objects with different RootViewProviders.