Instance Method


Accepts or rejects a new connection to the listener.


optional func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool


To accept the connection, first configure the connection if desired, then call resume() on the new connection, then return true.

To reject the connect, return a value of false. This causes the connection object to be invalidated.

In this method, you can also set up properties on the connection object, such as its exported object and interfaces. Be sure to call resume() when you are finished configuring the connection object and are ready for it to receive messages.

See Also

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software