<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSViewController/dismiss(_:)-91my5",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSViewController(im)dismissViewController:"
  },
  "title" : "dismiss(_:)"
}
-->

# dismiss(_:)

Dismisses a presented view controller, using the same animator that presented it.

```
func dismiss(_ viewController: NSViewController)
```

## Parameters

`viewController`

The presented view controller that you are dismissing.

## Discussion

In macOS, this is the universal way to dismiss a view controller, no matter how it was presented.

---

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)