---
title: preventsApplicationTerminationWhenModal
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nswindow/preventsapplicationterminationwhenmodal
---

# preventsApplicationTerminationWhenModal

A Boolean value that indicates whether the window prevents application termination when modal.

## Declaration

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

## Discussion

Discussion The value of this property is true if the window prevents application termination when modal; otherwise, false. The default value is true. Usually, application termination is prevented when a modal window or sheet is open, without consulting the application delegate. Some windows may wish not to prevent termination, however. Setting this property to false overrides the default behavior and allows termination to proceed even if the window is open, either through the sudden termination path if enabled, or after consulting the application delegate.

## See Also

### Configuring the Window’s Appearance

- [styleMask](appkit/nswindow/stylemask-swift.property.md)
- [NSWindow.StyleMask](appkit/nswindow/stylemask-swift.struct.md)
- [toggleFullScreen(_:)](appkit/nswindow/togglefullscreen(_:).md)
- [worksWhenModal](appkit/nswindow/workswhenmodal.md)
- [alphaValue](appkit/nswindow/alphavalue.md)
- [backgroundColor](appkit/nswindow/backgroundcolor.md)
- [colorSpace](appkit/nswindow/colorspace.md)
- [setDynamicDepthLimit(_:)](appkit/nswindow/setdynamicdepthlimit(_:).md)
- [canHide](appkit/nswindow/canhide.md)
- [isOnActiveSpace](appkit/nswindow/isonactivespace.md)
- [hidesOnDeactivate](appkit/nswindow/hidesondeactivate.md)
- [collectionBehavior](appkit/nswindow/collectionbehavior-swift.property.md)
- [isOpaque](appkit/nswindow/isopaque.md)
- [hasShadow](appkit/nswindow/hasshadow.md)
- [invalidateShadow()](appkit/nswindow/invalidateshadow().md)
