<!--
{
  "availability" : [
    "iOS: 10.0.0 - 12.0.0",
    "iPadOS: 10.0.0 - 12.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.12.0 - 10.14.0",
    "tvOS: 10.0.0 - 12.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKGameSession/remove(withIdentifier:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKGameSession(cm)removeSessionWithIdentifier:completionHandler:"
  },
  "title" : "remove(withIdentifier:completionHandler:)"
}
-->

# remove(withIdentifier:completionHandler:)

Removes the specified game session.

```
class func remove(withIdentifier identifier: String, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`identifier`

The unique string that identifies the game session to be removed.

`completionHandler`

A block that is called after a game session has been removed from a container.

- error: If an error occurred, this parameter holds an error object that explains the error. Otherwise, the value of this parameter is nil. See `GameKit Constants` for a list of error codes specific to GameKit.

## Discussion

After the user has finished a game or decides to abandon a game, you must use this function to remove the game session from iCloud. Game sessions are not removed from iCloud automatically.

---

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)