---
title: "canPerformUnwindSegueAction(_:from:withSender:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiviewcontroller/canperformunwindsegueaction(_:from:withsender:)"
---

# canPerformUnwindSegueAction(_:from:withSender:)

Called on a view controller to determine whether it wants to respond to an unwind action.

## Declaration

```swift
func canPerformUnwindSegueAction(_ action: Selector, from fromViewController: UIViewController, withSender sender: Any) -> Bool
```

## Parameters

- `action`: The unwind action to invoke on your view controller.
- `fromViewController`: The view controller that initiated the unwind action.
- `sender`: The object that triggered the action.

## Return Value

Return Value true if the view controller wants to handle the unwind action, otherwise false.

## Discussion

Discussion When an unwind segue is triggered, UIKit uses this method and the allowedChildrenForUnwinding(from:) method to locate a suitable view controller to handle the unwind segue. The default implementation of this method returns true when the current view controller implements the action method and is not the same view controller as the one in the fromViewController parameter. You can override this method as needed to change the default behavior. For example, you might return false if the current view controller does not make a suitable return target when unwinding from the specified view controller.

## See Also

### Deprecated methods

- [setOverrideTraitCollection(_:forChild:)](uikit/uiviewcontroller/setoverridetraitcollection(_:forchild:).md)
- [overrideTraitCollection(forChild:)](uikit/uiviewcontroller/overridetraitcollection(forchild:).md)
- [attemptRotationToDeviceOrientation()](uikit/uiviewcontroller/attemptrotationtodeviceorientation().md)
- [registerForPreviewing(with:sourceView:)](uikit/uiviewcontroller/registerforpreviewing(with:sourceview:).md)
- [unregisterForPreviewing(withContext:)](uikit/uiviewcontroller/unregisterforpreviewing(withcontext:).md)
- [didRotate(from:)](uikit/uiviewcontroller/didrotate(from:).md)
- [dismissMoviePlayerViewControllerAnimated()](uikit/uiviewcontroller/dismissmovieplayerviewcontrolleranimated().md)
- [forUnwindSegueAction(_:from:withSender:)](uikit/uiviewcontroller/forunwindsegueaction(_:from:withsender:).md)
- [presentMoviePlayerViewControllerAnimated(_:)](uikit/uiviewcontroller/presentmovieplayerviewcontrolleranimated(_:).md)
- [rotatingFooterView()](uikit/uiviewcontroller/rotatingfooterview().md)
- [rotatingHeaderView()](uikit/uiviewcontroller/rotatingheaderview().md)
- [segueForUnwinding(to:from:identifier:)](uikit/uiviewcontroller/segueforunwinding(to:from:identifier:).md)
- [shouldAutomaticallyForwardRotationMethods()](uikit/uiviewcontroller/shouldautomaticallyforwardrotationmethods().md)
- [willAnimateRotation(to:duration:)](uikit/uiviewcontroller/willanimaterotation(to:duration:).md)
- [willRotate(to:duration:)](uikit/uiviewcontroller/willrotate(to:duration:).md)
