---
title: "resolveConflictingSavedGames(_:with:completionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gklocalplayer/resolveconflictingsavedgames(_:with:completionhandler:)"
---

# resolveConflictingSavedGames(_:with:completionHandler:)

Replaces duplicate saved games that use the same filename with one file containing the specified game data.

## Declaration

```swift
func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data, completionHandler handler: (@Sendable ([GKSavedGame]?, (any Error)?) -> Void)? = nil)
```

```swift
func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame]
```

## Parameters

- `conflictingSavedGames`: The saved games that contain the conflicts.
- `data`: The correct game data to save.
- `handler`: The block that this method calls when it completes the request. The block receives the following parameters: For example, if there are five saved game files with the same filename, but only three are in conflictingSavedGames, this parameter contains the three saved games you provide and the two saved games GameKit finds.

## Mentioned in

Saving the player’s game data to an iCloud account

## Discussion

Discussion Implement the player(_:hasConflictingSavedGames:) protocol method to choose the correct game data when there’s a conflict. Then call this method separately for each set of saved games that contain file conflicts. For example, if multiple saved games use the savedgame1 and savedgame2 filenames, call this method once for the saved games that use the savedgame1 filename, and once for the saved games that use the savedgame2 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)
- [deleteSavedGames(withName:completionHandler:)](gamekit/gklocalplayer/deletesavedgames(withname:completionhandler:).md)
- [GKSavedGame](gamekit/gksavedgame.md)
- [GKSavedGameListener](gamekit/gksavedgamelistener.md)
