---
title: "animatePresentation(of:from:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsviewcontrollerpresentationanimator/animatepresentation(of:from:)"
---

# animatePresentation(of:from:)

Called when the specified view controller is about to be presented.

## Declaration

```swift
@MainActor func animatePresentation(of viewController: NSViewController, from fromViewController: NSViewController)
```

## Parameters

- `viewController`: The view controller that is being presented in place of the one in the fromViewController parameter.
- `fromViewController`: The view controller that is the parent of the one in the viewController parameter.

## Discussion

Discussion To add custom presentation animation, Implement it in this method.

## See Also

### Animating Presentation and Dismissal of View Controllers

- [animateDismissal(of:from:)](appkit/nsviewcontrollerpresentationanimator/animatedismissal(of:from:).md)
