---
title: withUniqueName()
framework: appkit
role: symbol
role_heading: Type Method
path: appkit/nspasteboard/withuniquename()
---

# withUniqueName()

Creates and returns a new pasteboard with a name that is guaranteed to be unique with respect to other pasteboards in the system.

## Declaration

```swift
class func withUniqueName() -> NSPasteboard
```

## Return Value

Return Value The new pasteboard object.

## Discussion

Discussion This method is useful for apps that implement their own interprocess communication using pasteboards. Because the lifetime of a unique pasteboard is not related to the lifetime of the creating app, you must release a unique pasteboard by calling releaseGlobally() to avoid possible leaks.

## See Also

### Creating and releasing a pasteboard

- [general](appkit/nspasteboard/general.md)
- [init(byFilteringData:ofType:)](appkit/nspasteboard/init(byfilteringdata:oftype:).md)
- [init(byFilteringFile:)](appkit/nspasteboard/init(byfilteringfile:).md)
- [init(byFilteringTypesInPasteboard:)](appkit/nspasteboard/init(byfilteringtypesinpasteboard:).md)
- [init(name:)](appkit/nspasteboard/init(name:).md)
- [NSPasteboard.Name](appkit/nspasteboard/name-swift.struct.md)
- [releaseGlobally()](appkit/nspasteboard/releaseglobally().md)
