loadLeaderboards(IDs:completionHandler:)
Loads leaderboards for the specified leaderboard IDs that Game Center uses.
Declaration
class func loadLeaderboards(IDs leaderboardIDs: [String]?, completionHandler: @escaping @Sendable ([GKLeaderboard]?, (any Error)?) -> Void)class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]Parameters
- leaderboardIDs:
An array of leaderboard IDs that Game Center uses.
- completionHandler:
A block that GameKit calls when this method loads the leaderboards.
The block receives the following parameters:
- leaderboards
The leaderboards that match the IDs.
- error
Describes an error if it occurs, or
nilif the operation completes.