Contents

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 GKLeaderboard objects that provides the leaderboards for your game.

    error

    Describes an error if it occurs, or nil if the operation completes.

See Also

Loading Leaderboard Sets