---
title: finalize()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsproxy/finalize()
---

# finalize()

The garbage collector invokes this method on the receiver before disposing of the memory it uses.

## Declaration

```swift
func finalize()
```

## Discussion

Discussion This method behaves as described in the NSObject class specification under the finalize() instance method. Note that a finalize method must be thread-safe.

## See Also

### Related Documentation

- [dealloc()](foundation/nsproxy/dealloc().md)
