setDefaultLeaderboardCategoryID(_:completionHandler:)
Sets the category identifier for the local player’s default leaderboard.
Declaration
func setDefaultLeaderboardCategoryID(_ categoryID: String?, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)func setDefaultLeaderboardCategoryID(_ categoryID: String?) async throwsParameters
- categoryID:
The category ID string for one of your game’s leaderboards.
- completionHandler:
A block to call when the request completes.
The block receives the following parameter:
- error
If an error occurs, this parameter holds an error object that explains the error. Otherwise, the value of this parameter is
nil.
Discussion
You set the default leaderboard in App Store Connect when you configure your game’s leaderboards. All players normally start with this leaderboard as the default leaderboard. Calling this method changes the default leaderboard only for the local player.