---
title: "forSelector(_:argumentIndex:ofReply:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsxpcinterface/forselector(_:argumentindex:ofreply:)"
---

# forSelector(_:argumentIndex:ofReply:)

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

## Declaration

```swift
func forSelector(_ sel: Selector, argumentIndex arg: Int, ofReply: Bool) -> NSXPCInterface?
```

## Parameters

- `sel`: Specifies which method in the protocol you want information about.
- `arg`: Specifies the position (starting at index 0) of the parameter for which you want to obtain the current interface. This may be either the position of a parameter in the method itself or the position in its reply block.
- `ofReply`: Pass doc://com.apple.documentation/documentation/Swift/true if arg is an index into the parameters of the reply block, or doc://com.apple.documentation/documentation/Swift/false if it is an index into the parameters of the method itself.

## Discussion

Discussion See setInterface(_:for:argumentIndex:ofReply:) for more explanation.
