UIViewController

public extension UIViewController
  • Iterates through the view controller stack to finds a UIViewController instance.

    Declaration

    Swift

    static func findViewController(in viewController: UIViewController,
                                   options: SearchOptions = .currentAndUp,
                                   containerAdapterLocator: ContainerAdapterLocator = RouteComposerDefaults.shared.containerAdapterLocator,
                                   using predicate: (UIViewController) -> Bool) throws -> UIViewController?

    Parameters

    viewController

    A UIViewController instance to start from.

    options

    A combination of SearchOptions.

    containerAdapterLocator
    predicate

    A block that should return true if the UIViewController instance provided is the one that is being searched for.

    Return Value

    A UIViewController instance if found, nil otherwise.