<!--
{
  "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: 3.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKSession/sessionMode",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKSession(py)sessionMode"
  },
  "title" : "sessionMode"
}
-->

# sessionMode

The mode the session uses to find other peers.

```
var sessionMode: GKSessionMode { get }
```

## Discussion

The session mode changes the behavior of the session when [`isAvailable`](/documentation/GameKit/GKSession/isAvailable) is set to <doc://com.apple.documentation/documentation/Swift/true>.

- A [`GKSessionMode.server`](/documentation/GameKit/GKSessionMode/server) session advertises itself to local devices using its session ID.
- A [`GKSessionMode.client`](/documentation/GameKit/GKSessionMode/client) session searches for local devices advertising the same session ID. As it discovers available and compatible peers, it calls the delegate’s  [`session(_:peer:didChange:)`](/documentation/GameKit/GKSessionDelegate/session(_:peer:didChange:)) method.
- A [`GKSessionMode.peer`](/documentation/GameKit/GKSessionMode/peer) session both advertises as a server and searches as a client.

## See Also

[`var isAvailable: Bool`](/documentation/GameKit/GKSession/isAvailable)

A Boolean value that determines whether or not the session wants to connect to new peers.



---

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)