Contents

fetchSavedGames(completionHandler:)

Retrieves all available saved games.

Declaration

func fetchSavedGames(completionHandler handler: (@Sendable ([GKSavedGame]?, (any Error)?) -> Void)? = nil)
func fetchSavedGames() async throws -> [GKSavedGame]

Parameters

  • handler:

    The block that this method calls when it completes the request.

    The block receives the following parameters:

    savedGames

    An array of saved games that GameKit fetches.

    error

    Describes an error if it occurs, or nil if the operation completes.

Mentioned in

Discussion

If more than one saved game has the same filename, a conflict occurs and you must choose which saved game filename is correct using the resolveConflictingSavedGames(_:with:completionHandler:) method.

See Also

Saving Game Data