---
title: "writeLock(completionHandler:)"
framework: corenfc
role: symbol
role_heading: Instance Method
path: "corenfc/nfcndeftag/writelock(completionhandler:)"
---

# writeLock(completionHandler:)

Changes the NDEF tag status to read-only, preventing future write operations.

## Declaration

```swift
func writeLock(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func writeLock() async throws
```

## Parameters

- `completionHandler`: The handler invoked by the reader session after completing the lock request. The session calls completionHandler on the dispatch queue provided when creating the doc://com.apple.corenfc/documentation/CoreNFC/NFCNDEFReaderSession. The handler has the following parameter:

## Discussion

Discussion Calling this method updates the write access condition byte in the NDEF File Control of the tag’s file system, thus locking the tag. This is a permanent action that you cannot undo. After locking the tag, you can no longer write data to it.

## See Also

### Writing to the Tag

- [writeNDEF(_:completionHandler:)](corenfc/nfcndeftag/writendef(_:completionhandler:).md)
