---
title: unlock()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsdistributedlock/unlock()
---

# unlock()

Relinquishes the receiver.

## Declaration

```swift
func unlock()
```

## Discussion

Discussion You should generally use the unlock() method rather than break() to release a lock. An NSGenericException is raised if the receiver doesn’t already exist.

## See Also

### Relinquishing a Lock

- [break()](foundation/nsdistributedlock/break().md)
