Contents

init(port:data:)

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

Declaration

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(_:) 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 layer hierarchy handle using Mach