UIViewController
public extension UIViewController
-
Iterates through the view controller stack to finds a
UIViewControllerinstance.Declaration
Swift
@MainActor static func findViewController(in viewController: UIViewController, options: SearchOptions = .currentAndUp, containerAdapterLocator: ContainerAdapterLocator = RouteComposerDefaults.shared.containerAdapterLocator, using predicate: (UIViewController) -> Bool) throws -> UIViewController?Parameters
viewControllerA
UIViewControllerinstance to start from.optionsA combination of
SearchOptions.containerAdapterLocatorA
ContainerAdapterLocatorinstance.predicateA block that should return
trueif theUIViewControllerinstance provided is the one that is being searched for.Return Value
A
UIViewControllerinstance if found,nilotherwise.