<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPasteboard/setPropertyList(_:forType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPasteboard(im)setPropertyList:forType:"
  },
  "title" : "setPropertyList(_:forType:)"
}
-->

# setPropertyList(_:forType:)

Sets the given property list as the representation for the specified type for the first item on the receiver.

```
func setPropertyList(_ plist: Any, forType dataType: NSPasteboard.PasteboardType) -> Bool
```

## Parameters

`plist`

The property list data to write to the pasteboard.

`dataType`

The type of property-list data in the `propertyList` parameter. The type must have been declared by a previous [`declareTypes(_:owner:)`](/documentation/AppKit/NSPasteboard/declareTypes(_:owner:)) message.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the data was written successfully, otherwise <doc://com.apple.documentation/documentation/Swift/false> if ownership of the pasteboard has changed. Any other error raises an `NSPasteboardCommunicationException`.

## Discussion

This method invokes [`setData(_:forType:)`](/documentation/AppKit/NSPasteboard/setData(_:forType:)) with a serialized property list parameter.

## See Also

[`-  propertyListForType:`](/documentation/AppKit/NSPasteboard/propertyList(forType:))

Returns the property list for the specified type from the first item in the receiver that contains the type.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)