---
title: "init(plistObject:)"
framework: xctest
role: symbol
role_heading: Initializer
path: "xctest/xctattachment/init(plistobject:)"
---

# init(plistObject:)

Creates an attachment from an object that can be represented in an XML property list.

## Declaration

```swift
convenience init(plistObject object: Any)
```

## Parameters

- `object`: An object that can be serialized to an XML property list format, such as an array, dictionary, string, or date.

## Discussion

Discussion The content of the attachment is an XML property list representation of the provided object with a uniformTypeIdentifier value of "com.apple.xml-property-list". note: Creating an attachment with a non-property-list-compatible object will trigger an exception at the point that the attachment is added to an XCTActivity.

## See Also

### Creating Attachments from Objects

- [init(archivableObject:)](xctest/xctattachment/init(archivableobject:).md)
- [init(archivableObject:uniformTypeIdentifier:)](xctest/xctattachment/init(archivableobject:uniformtypeidentifier:).md)
