---
title: "init(port:data:)"
framework: browserenginekit
role: symbol
role_heading: Initializer
path: "browserenginekit/layerhierarchyhostingtransactioncoordinator/init(port:data:)"
---

# init(port:data:)

Creates a transaction coordinator using a Mach port reference and serialized data.

## Declaration

```swift
init(port: mach_port_t, data: Data) throws
```

## Parameters

- `port`: A Mach port (mach_port_t) that references the coordinator.
- `data`: The serialized data with which to reconstruct the coordinator.

## Discussion

Discussion Use this initializer to reconstruct a transaction coordinator that your app serializes using encode(_:) in another process. This method takes ownership of the Mach port send right, even if an error occurs; don’t use or deallocate the port after calling this method.

## See Also

### Sharing a transaction coordinator using Mach

- [encode(_:)](browserenginekit/layerhierarchyhostingtransactioncoordinator/encode(_:).md)
