---
title: "setScore(on:to:context:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkgameactivity/setscore(on:to:context:)"
---

# setScore(on:to:context:)

Set a score of a leaderboard with a context for a player.

## Declaration

```swift
func setScore(on leaderboard: GKLeaderboard, to score: Int, context: Int)
```

## Mentioned in

Creating activities for your game

## Discussion

Discussion The framewwork submits the score to the leaderboard when the activity ends.

## See Also

### Getting and removing leaderboard scores

- [leaderboardScores](gamekit/gkgameactivity/leaderboardscores.md)
- [score(on:)](gamekit/gkgameactivity/score(on:).md)
- [setScore(on:to:)](gamekit/gkgameactivity/setscore(on:to:).md)
- [removeScores(from:)](gamekit/gkgameactivity/removescores(from:).md)
