CurrentlyVisibleViewFinder
open class CurrentlyVisibleViewFinder : ViewFinder
Class, capable of finding currently visible view, using recursive search through UIViewController, UINavigationController and UITabBarController APIs.
-
Provider of root view in hierarchy
Declaration
Swift
public let rootViewProvider: RootViewProvider?
-
Creates
CurrentlyVisibleViewFinder
.Declaration
Swift
public init(rootViewProvider: RootViewProvider?)
Parameters
rootViewProvider
provider of root view in hierarchy
-
Searches view hierarhcy for currently visible view. If no visible view was found, root view controller from
rootViewProvider
is returned.Declaration
Swift
open func currentlyVisibleView(startingFrom view: ViewController? = nil) -> ViewController?
Parameters
view
view controller to start search from. When nil is passed as an argument, search starts from rootViewController. Defaults to nil.
Return Value
currently visible view or rootViewController if none was found.
-
Recursively searches view hierarchy for currently visible view.
Declaration
Swift
open func findCurrentlyVisibleView(startingFrom view: ViewController?) -> ViewController?
Parameters
view
view to start search from
Return Value
currently visible view.