loadLeaderboards(completionHandler:)
Loads all of the leaderboards for the current leaderboard set.
Declaration
func loadLeaderboards(completionHandler: (@Sendable ([GKLeaderboard]?, (any Error)?) -> Void)? = nil)func loadLeaderboards() async throws -> [GKLeaderboard]Parameters
- completionHandler:
A block that this method calls when it loads the leaderboards.
The block receives the following parameters:
- leaderboards
An array of
GKLeaderboardobjects that provides the leaderboards for your game.- error
Describes an error if it occurs, or
nilif the operation completes.