Retrieves all available saved games.
SDKs
- iOS 8.0+
- macOS 10.10+
Framework
- Game
Kit
Declaration
func fetchSavedGames(completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil)
Parameters
handler
A block to be called when the request completes.
The block receives the following parameters:
- savedGames
An array of
GKSaved
objects containing the retrieved games.Game
- error
If an error occurred, this parameter holds an error object that explains the error. Otherwise, the value of this parameter is
nil
.
Discussion
This method retrieves saved game files asynchronously. When there is more than one saved game with the same name, a conflict occurs. The app must determine which saved game file is correct and call the resolve
method.