---
title: "peerPickerController(_:didConnectPeer:to:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkpeerpickercontrollerdelegate/peerpickercontroller(_:didconnectpeer:to:)"
---

# peerPickerController(_:didConnectPeer:to:)

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

## Declaration

```swift
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

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.
