TechnologiesFoundation, System & Concurrency

XPC

iOSmacOStvOSwatchOSvisionOS

XPC provides Swift wrappers over libxpc for inter-process communication built on XPC objects. You establish connections between processes with XPCSession and accept incoming ones with XPCListener, then exchange structured data using value types such as XPCArray, XPCDictionary, and XPCLiteralValue. Received traffic arrives as an XPCReceivedMessage, while XPCEndpoint, XPCPeerRequirement, and XPCRichError support addressing peers, expressing requirements, and reporting failures across the connection.

Connections and Listeners 4

Establish outgoing connections to peers and accept incoming ones across processes.

  • Cl
    XPCSessioniOS 17.0+
    A `XPCSession` is a replacement for `xpc_connection_t` and provides similar
  • Cl
    XPCListeneriOS 17.0+
    A `XPCListener` is the server-side equivalent to an `XPCSession` and
  • Cl
    OS_xpc_session
    @define XPC_TYPE_SESSION
  • Cl
    OS_xpc_listener
    @typedef xpc_listener_t

Message Values 4

Structured value types used to compose and read the contents of XPC messages.

  • St
    XPCArrayiOS 16.0+
    A value type that holds an ordered collection of values within an XPC message.
  • St
    XPCDictionaryiOS 16.0+
    A value type that holds a keyed collection of values within an XPC message.
  • St
    XPCLiteralValueiOS 27.0+
    A type that bridges Swift literal values to XPC objects for use in dictionary literals.
  • Pr
    OS_xpc_object
    A protocol adopted by the reference-counted object types that make up the XPC runtime.

Receiving Messages 1

Inspect and respond to traffic that arrives over a connection.

  • St
    XPCReceivedMessageiOS 17.0+
    A `XPCReceivedMessage` is a replacement for `XPCDictionary` for Codable messages.

Addressing and Security 2

Reference remote peers and express the requirements they must satisfy.

  • St
    XPCEndpoint
    A connection in serialized form.
  • St
    XPCPeerRequirement
    A value that expresses the criteria a connecting peer must satisfy.

Configuration and Errors 2

Configure session creation and report failures encountered on a connection.

  • St
    xpc_session_create_flags_t
    Constants that configure the behavior of a newly created XPC session.
  • St
    XPCRichErroriOS 17.0+
    A `XPCRichError` is a replacement for `XPC_ERROR_*` objects that

Protocols 1

  • Pr
    XPCPeerHandleriOS 17.0+
    Protocol for communicating with a peer `XPCSession`

Type Aliases 20

  • Ty
    xpc_type_t
    @typedef xpc_type_t
  • Ty
    xpc_object_t
  • Ty
    xpc_handler_t
  • Ty
    xpc_connection_t
  • Ty
    xpc_connection_handler_t
    @typedef xpc_connection_handler_t
  • Ty
    xpc_endpoint_t
  • Ty
    xpc_rich_error_t
  • Ty
    xpc_activity_t
    @typedef xpc_activity_t
  • Ty
    xpc_activity_handler_t
    @typedef xpc_activity_handler_t
  • Ty
    xpc_activity_state_t
  • Ty
    xpc_peer_requirement_t
    @typedef xpc_peer_requirement_t
  • Ty
    xpc_finalizer_t
    @typedef xpc_finalizer_f
  • Ty
    xpc_session_t
    @define XPC_TYPE_SESSION
  • Ty
    xpc_listener_t
    @typedef xpc_listener_t
  • Ty
    xpc_listener_incoming_session_handler_t
  • Ty
    xpc_array_applier_t
Show 4 more
  • Ty
    xpc_dictionary_applier_t
  • Ty
    xpc_session_cancel_handler_t
  • Ty
    xpc_session_incoming_message_handler_t
  • Ty
    xpc_session_reply_handler_t
← Foundation, System & Concurrency