<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSXPCInterface",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSXPCInterface"
  },
  "title" : "NSXPCInterface"
}
-->

# NSXPCInterface

An interface that may be sent to an exported object or remote object proxy.

```
class NSXPCInterface
```

## Overview

This object holds all information about the interface of an exported object or remote object proxy. It describes what messages are allowed, what kinds of objects are allowed as arguments, what the signature of any reply blocks are, and information about additional proxy objects.

## Topics

### Initializers

[`init(with: Protocol)`](/documentation/Foundation/NSXPCInterface/init(with:))

Returns an NSXPCInterface instance for a given protocol.

[`init(withProtocol: Protocol)`](/documentation/Foundation/NSXPCInterface/init(withProtocol:))

### Instance Properties

[`var `protocol`: Protocol`](/documentation/Foundation/NSXPCInterface/protocol)

The Objective-C protocol that this interface is based on.

### Instance Methods

[`func classes(for: Selector, argumentIndex: Int, ofReply: Bool) -> Set<AnyHashable>`](/documentation/Foundation/NSXPCInterface/classes(for:argumentIndex:ofReply:))

Returns the current list of allowed classes that can appear within the specified collection object argument to the specified method.

[`func forSelector(Selector, argumentIndex: Int, ofReply: Bool) -> NSXPCInterface?`](/documentation/Foundation/NSXPCInterface/forSelector(_:argumentIndex:ofReply:))

Returns the interface previously set for the specified selector and parameter.

[`func setClasses(Set<AnyHashable>, for: Selector, argumentIndex: Int, ofReply: Bool)`](/documentation/Foundation/NSXPCInterface/setClasses(_:for:argumentIndex:ofReply:))

Sets the classes that can appear within the (numerically) specified collection object argument to the specified method.

[`func setInterface(NSXPCInterface, for: Selector, argumentIndex: Int, ofReply: Bool)`](/documentation/Foundation/NSXPCInterface/setInterface(_:for:argumentIndex:ofReply:))

Configures a specific parameter of a method to be sent as a proxy object instead of copied.

[`func setXPCType(xpc_type_t, for: Selector, argumentIndex: Int, ofReply: Bool)`](/documentation/Foundation/NSXPCInterface/setXPCType(_:for:argumentIndex:ofReply:))

[`func xpcType(for: Selector, argumentIndex: Int, ofReply: Bool) -> xpc_type_t?`](/documentation/Foundation/NSXPCInterface/xpcType(for:argumentIndex:ofReply:))

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)