<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UINavigationControllerDelegate/navigationController(_:animationControllerFor:from:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UINavigationControllerDelegate(im)navigationController:animationControllerForOperation:fromViewController:toViewController:"
  },
  "title" : "navigationController(_:animationControllerFor:from:to:)"
}
-->

# navigationController(_:animationControllerFor:from:to:)

Allows the delegate to return a noninteractive animator object for use during view controller transitions.

```
optional func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationController.Operation, from fromVC: UIViewController, to toVC: UIViewController) -> (any UIViewControllerAnimatedTransitioning)?
```

## Parameters

`navigationController`

The navigation controller whose navigation stack is changing.

`operation`

The type of transition operation that is occurring. For a list of possible values, see the [`UINavigationController.Operation`](/documentation/UIKit/UINavigationController/Operation) constants.

`fromVC`

The currently visible view controller.

`toVC`

The view controller that should be visible at the end of the transition.

## Return Value

The animator object responsible for managing the transition animations, or `nil` if you want to use the standard navigation controller transitions. The object you return must conform to the [`UIViewControllerAnimatedTransitioning`](/documentation/UIKit/UIViewControllerAnimatedTransitioning) protocol.

## Discussion

Implement this delegate method when you want to provide a custom animated transition between view controllers as they are added to or removed from the navigation stack. The object you return should be capable of configuring and performing noninteractive animations for the specified view controllers for the specified type of operation over a fixed period of time.

If you want to allow the user to perform interactive transitions, you must *also* implement the [`navigationController(_:interactionControllerFor:)`](/documentation/UIKit/UINavigationControllerDelegate/navigationController(_:interactionControllerFor:)) method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)