---
title: isLocked
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsdocument/islocked
---

# isLocked

A Boolean value that indicates whether or not the file can be written to.

## Declaration

```swift
var isLocked: Bool { get }
```

## Discussion

Discussion This property may contain the value true because the user lacks the appropriate write permissions, the “user immutable” flag was raised, the parent directory or volume is read only, or the checkAutosavingSafety() method returned false. Do not override this property.

## See Also

### Locking the Document

- [lock(_:)](appkit/nsdocument/lock(_:).md)
- [unlock(_:)](appkit/nsdocument/unlock(_:).md)
- [lock(completionHandler:)](appkit/nsdocument/lock(completionhandler:)-6zuhh.md)
- [lock(completionHandler:)](appkit/nsdocument/lock(completionhandler:)-161qv.md)
- [unlock(completionHandler:)](appkit/nsdocument/unlock(completionhandler:)-8p8zd.md)
- [unlock(completionHandler:)](appkit/nsdocument/unlock(completionhandler:)-6m7rh.md)
