dbasal
dbasal

Reputation: 36

GameCenter Displaying a Leaderboard Set

I am having difficulties getting my leaderboard sets to display. Not sure if it is possible, but so far I am not able to get it working.

For some background, I have levels in my game and within each level I have 3 scoring metrics, so I have a leaderboard set for each level.

For example:

Level 1 Leaderboard Set
    |----- Level 1 Points Leaderboard
    |----- Level 1 Average Time Leaderboard
    |----- Level 1 Best Time Leaderboard

When the level is complete, I want to display the Level 1 Leaderboard set and not an individual leaderboard. So far no go.

Here is the code:

var gc = GKGameCenterViewController()
gc.gameCenterDelegate = self
gc.viewState = GKGameCenterViewControllerState.Leaderboards
gc.leaderboardIdentifier = boardid
self.presentViewController(gc, animated:true, completion: nil)

where boardid is the id of the leaderboard set.

Upvotes: 2

Views: 462

Answers (1)

Entitize
Entitize

Reputation: 4969

You must make boardid a string. Put quotations around boardid

gc.leaderboardIdentifier = "boardid" //Put quotations

Hope this helped!

Upvotes: 1

Related Questions