<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BrowserEngineKit",
  "identifier" : "/documentation/BrowserEngineKit/LayerHierarchyHandle/init(port:data:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "BrowserEngineKit"
    ],
    "preciseIdentifier" : "c:objc(cs)BELayerHierarchyHandle(cm)handleWithPort:data:error:"
  },
  "title" : "init(port:data:)"
}
-->

# init(port:data:)

Creates a layer hierarchy handle using a Mach port reference and serialized data.

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

## Parameters

`port`

A Mach port (`mach_port_t`) that references the layer hierarchy.

`data`

The serialized data with which to reconstruct the handle.

## Discussion

Use this initializer to reconstruct a layer hierarchy handle that your app serializes using [`encode(_:)`](/documentation/BrowserEngineKit/LayerHierarchyHandle/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.

---

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)