---
title: "init(xpcRepresentation:)"
framework: accessoryaccess
role: symbol
role_heading: Initializer
path: "accessoryaccess/aausbaccessory/init(xpcrepresentation:)-6dmbu"
---

# init(xpcRepresentation:)

Creates a USB accessory from an XPC representation.

## Declaration

```swift
init?(xpcRepresentation: xpc_object_t)
```

## Parameters

- `xpcRepresentation`: The XPC representation of an AAUSBAccessory object received from the XPC.

## Return Value

Return Value An AAUSBAccessory object if the framework decoded the provided xpc_object_t, or nil if it’s invalid.

## See Also

### Creating USB accessories

- [init(XPCRepresentation:)](accessoryaccess/aausbaccessory/init(xpcrepresentation:)-5lxcr.md)
- [init(coder:)](accessoryaccess/aausbaccessory/init(coder:).md)
