Reputation: 363
I am submitting a score to a GKLeaderboard but want to show the player the rank they got with this score.
I believe only the top score is stored so I cannot look for the rank of the specific store in the general table, e.g.: You scored 200 Points which would be rank 5 will not be saved, when the player has already rank 2 with 300 points, is this correct?
Alternatively I would like to present how many points are missing to reach the first rank.
Is there an easy way to retrieve the top score for a specific leaderboard?
whatever I try the functions seem to be deprecated: (also most help texts on here and also the AI supported guide highlights deprecated code.)
'scores' was deprecated in iOS 14.0
My code to submit the score is quite easy, so I would be expecting something simple exists to retrieve a score in the leaderboard as well.
GKLeaderboard.submitScore(value, context: 1, player: GKLocalPlayer.local, leaderboardIDs: [leaderboardID])
my expectation would be something like: let topscore = GKLeadearboard["Easy"].fetchTopScore()
Upvotes: 1
Views: 36