---
title: close()
framework: quicklookui
role: symbol
role_heading: Instance Method
path: quicklookui/qlpreviewview/close()
---

# close()

Closes the view, releasing the current preview item.

## Declaration

```swift
func close()
```

## Discussion

Discussion Once a QLPreviewView is closed, it won’t accept any more preview items. You only need to call this method if shouldCloseWithWindow is set to false. If you don’t close a QLPreviewView when you are done using it, your app will leak memory.

## See Also

### Closing a Preview

- [shouldCloseWithWindow](quicklookui/qlpreviewview/shouldclosewithwindow.md)
