Contents

submitScore(_:context:player:completionHandler:)

Submits a score to the leaderboard.

Declaration

func submitScore(_ score: Int, context: Int, player: GKPlayer, completionHandler: @escaping  @Sendable ((any Error)?) -> Void)
func submitScore(_ score: Int, context: Int, player: GKPlayer) 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.

  • 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