<!--
{
  "availability" : [
    "iOS: 3.0.0 - 7.0.0",
    "iPadOS: 3.0.0 - 7.0.0",
    "macOS: 10.8.0 - 10.10.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKSessionDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKSessionDelegate"
  },
  "title" : "GKSessionDelegate"
}
-->

# GKSessionDelegate

An object implements the [`GKSessionDelegate`](/documentation/GameKit/GKSessionDelegate) protocol to control the behavior of a [`GKSession`](/documentation/GameKit/GKSession) object. The delegate is called when other visible peers change their state relative to the session. It is also called to determine whether another peer is allowed to connect to the session.

```
protocol GKSessionDelegate : NSObjectProtocol
```

## Topics

### Observing Changes to Peers

[`-  session:peer:didChangeState:`](/documentation/GameKit/GKSessionDelegate/session(_:peer:didChange:))

Received by the delegate when a peer changes state.

### Connection Requests from Other Peers

[`-  session:didReceiveConnectionRequestFromPeer:`](/documentation/GameKit/GKSessionDelegate/session(_:didReceiveConnectionRequestFromPeer:))

Received by the delegate when a remote peer wants to create a connection to the session.

### Connection Errors

[`-  session:connectionWithPeerFailed:withError:`](/documentation/GameKit/GKSessionDelegate/session(_:connectionWithPeerFailed:withError:))

Received by the delegate when an attempt to connect to another peer failed.

[`-  session:didFailWithError:`](/documentation/GameKit/GKSessionDelegate/session(_:didFailWithError:))

Sent to the delegate when a serious error has occurred in the session.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)