<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLook",
  "identifier" : "/documentation/QuickLook/PreviewSession/close()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quick Look"
    ],
    "preciseIdentifier" : "s:9QuickLook14PreviewSessionV5closeyyYaKF"
  },
  "title" : "close()"
}
-->

# close()

Closes the preview session.

```
func close() async throws
```

## Discussion

If the existing session is still open, this method closes it. The session’s events stream receives a `.didClose` event upon success.

> Throws: An `Error` if it is not possible to close the PreviewSession.

---

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)