Contents

forUnwindSegueAction(_:from:withSender:)

Called when an unwind segue action wants to search a container’s children for a view controller to handle the unwind action.

Declaration

func forUnwindSegueAction(_ action: Selector, from fromViewController: UIViewController, withSender sender: Any?) -> UIViewController?

Parameters

  • action:

    The action that triggered the unwind action.

  • fromViewController:

    The view controller that is the source of the unwinding action.

  • sender:

    The object that initiated the action.

Return Value

The view controller that wants to handle the unwind action.

Discussion

A custom container view controller should override this method and use it to search its children for a view controller to handle the unwind action. It does this by invoking the canPerformUnwindSegueAction(_:from:withSender:) method on each child. If a view controller wants to handle the action, your method should return it. If none of the container’s children want to handle the unwind action, invoke the super’s implementation and return the result of that method.

See Also

Deprecated methods