<!--
{
  "availability" : [
    "iOS: 3.0.0 - 7.0.0",
    "iPadOS: 3.0.0 - 7.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKPeerPickerControllerDelegate/peerPickerController(_:didConnectPeer:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKPeerPickerControllerDelegate(im)peerPickerController:didConnectPeer:toSession:"
  },
  "title" : "peerPickerController(_:didConnectPeer:to:)"
}
-->

# peerPickerController(_:didConnectPeer:to:)

Tells the delegate that the controller connected a peer to the session.

```
optional func peerPickerController(_ picker: GKPeerPickerController, didConnectPeer peerID: String, to session: GKSession)
```

## Parameters

`picker`

The controller that connected the peer.

`peerID`

The identification string for the peer that connected to the session.

`session`

The session that the peer is connected to.

## Discussion

Once a peer is connected to the session, your application should take ownership of the session, dismiss the peer picker, and then use the session to communicate with the other peer.

> Important:
> Although optional in the protocol, Game Kit expects your application to implement this method.

---

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)