---
title: "canInit(with:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nssound/caninit(with:)"
---

# canInit(with:)

Indicates whether the receiver can create an instance of itself from the data in a pasteboard.

## Declaration

```swift
class func canInit(with pasteboard: NSPasteboard) -> Bool
```

## Parameters

- `pasteboard`: Pasteboard containing sound data.

## Return Value

Return Value true when the receiver can handle the data represented by pasteboard; false otherwise.

## Discussion

Discussion The NSSound method is used to find out whether the class can handle the data in pasteboard.

## See Also

### Related Documentation

- [Sound Programming Topics for Cocoa](apple-archive/documentation/Cocoa/Conceptual/Sound.md)

### Creating Sounds

- [init(contentsOfFile:byReference:)](appkit/nssound/init(contentsoffile:byreference:).md)
- [init(contentsOf:byReference:)](appkit/nssound/init(contentsof:byreference:).md)
- [init(data:)](appkit/nssound/init(data:).md)
- [init(pasteboard:)](appkit/nssound/init(pasteboard:).md)
