---
title: "deleteSavedGames(withName:completionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gklocalplayer/deletesavedgames(withname:completionhandler:)"
---

# deleteSavedGames(withName:completionHandler:)

Deletes saved games with the specified filename.

## Declaration

```swift
func deleteSavedGames(withName name: String, completionHandler handler: (@Sendable ((any Error)?) -> Void)? = nil)
```

```swift
func deleteSavedGames(withName name: String) async throws
```

## Parameters

- `name`: A string that identifies the saved game data to delete.
- `handler`: The block that this method calls when it completes the request. The block receives the following parameters:

## Mentioned in

Saving the player’s game data to an iCloud account

## Discussion

Discussion Alternatively, use the resolveConflictingSavedGames(_:with:completionHandler:) method to keep one of the saved games that use the same filename.

## See Also

### Saving Game Data

- [Saving the player’s game data to an iCloud account](gamekit/saving-the-player-s-game-data-to-an-icloud-account.md)
- [saveGameData(_:withName:completionHandler:)](gamekit/gklocalplayer/savegamedata(_:withname:completionhandler:).md)
- [fetchSavedGames(completionHandler:)](gamekit/gklocalplayer/fetchsavedgames(completionhandler:).md)
- [resolveConflictingSavedGames(_:with:completionHandler:)](gamekit/gklocalplayer/resolveconflictingsavedgames(_:with:completionhandler:).md)
- [GKSavedGame](gamekit/gksavedgame.md)
- [GKSavedGameListener](gamekit/gksavedgamelistener.md)
