Contents

submitScore(_:context:player:leaderboardIDs:completionHandler:)

Submits a score to multiple leaderboards.

Declaration

class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String], completionHandler: @escaping  @Sendable ((any Error)?) -> Void)
class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String]) async throws

Parameters

  • score:

    The score that the player earns.

  • context:

    An integer value that your game uses.

  • player:

    The player who earns the score.

  • leaderboardIDs:

    The IDs that Game Center uses for the leaderboards to submit the score to.

  • completionHandler:

    A block that GameKit calls when this method adds the score.

    The block receives the following parameters:

    error

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

Mentioned in

See Also

Submitting Scores