accept
TypeScriptaccept(connection: _Foundation_NSXPCConnection): Promise<boolean>Swift declarationnonisolated func accept(connection: NSXPCConnection) -> BoolReturns a Boolean value that indicates whether you accept an incoming connection request from the host app. - Parameters: - connection: A connection object you can use to communicate with the host app. - Returns: `true` if you accept the connection to the host app, or `false` if you don’t. Implement this method in your custom type and use it to establish communication between your app extension and the host app that made the request. To accept a connection request, set the connection’s <doc://com.apple.documentation/documentation/foundation/nsxpcconnection/exportedobject> property to an object in your app extension that implements a protocol or type from the host’s SDK. Similarly, put the type information in the <doc://com.apple.documentation/documentation/foundation/nsxpcconnection/exportedinterface> property. You can also retrieve other relevant properties of the connection object, such as the remote connection details, and use them to set up your app extension. When you’re ready to start communicating with the host, call the connection’s <doc://com.apple.documentation/documentation/foundation/nsxpcconnection/resume()> method and then return `true` from this method.