---
title: shouldCloseWithWindow
framework: quicklookui
role: symbol
role_heading: Instance Property
path: quicklookui/qlpreviewview/shouldclosewithwindow
---

# shouldCloseWithWindow

A Boolean value that determines whether the preview should close when its window closes.

## Declaration

```swift
var shouldCloseWithWindow: Bool { get set }
```

## Discussion

Discussion The default value of this property is true, which means that the preview automatically closes when its window closes. If you set this property to false, close the preview by calling the close() method when finished with it. Once you close a QLPreviewView, it won’t accept any more preview items.

## See Also

### Closing a Preview

- [close()](quicklookui/qlpreviewview/close().md)
