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

# animateDismissal(of:from:)

Called when a previously-presented view controller is about to be dismissed.

## Declaration

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

## Parameters

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

## Discussion

Discussion To add custom view controller dismissal animation, Implement it in this method.

## See Also

### Animating Presentation and Dismissal of View Controllers

- [animatePresentation(of:from:)](appkit/nsviewcontrollerpresentationanimator/animatepresentation(of:from:).md)
