---
title: unlockFocus()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsimage/unlockfocus()
---

# unlockFocus()

Removes the focus from the image.

## Declaration

```swift
func unlockFocus()
```

## Discussion

Discussion This message must be sent after a successful lockFocus() or lockFocusOnRepresentation: message and the completion of any intermediate drawing commands. This method restores the focus to the previous owner, if any. Do not send this message if the preceding call to lock focus raised an NSImageCacheException.

## See Also

### Instance Methods

- [lockFocus()](appkit/nsimage/lockfocus().md)
- [lockFocusFlipped(_:)](appkit/nsimage/lockfocusflipped(_:).md)
- [init(iconRef:)](appkit/nsimage/init(iconref:).md)
