One Logo Pool Ball
GameKit · IOS API REFERENCE

GKLeaderboard

class · iOS 4.1+ · SDK 27.1

class GKLeaderboard

Members (35)

static · iOS 6.0+ · Deprecated in iOS 14.0

loadLeaderboards

TypeScript
static loadLeaderboardsCompletionHandler(completionHandler?: (((arg0: (Array<GKLeaderboard>) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
class func loadLeaderboards() async throws -> [GKLeaderboard]
static · iOS 14.0+

loadLeaderboards

TypeScript
static loadLeaderboardsIDsCompletionHandler(leaderboardIDs: (Array<string>) | null, completionHandler: ((arg0: (Array<GKLeaderboard>) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]
static · iOS 14.0+

submitScore

TypeScript
static submitScoreContextPlayerLeaderboardIDsCompletionHandler(score: number, context: number, player: GKPlayer, leaderboardIDs: Array<string>, completionHandler: ((arg0: (NativeError) | null) => void)): void
Swift declaration
class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String]) async throws
init · iOS 4.1+ · Deprecated in iOS 8.0

init

TypeScript
static initPlayerIDs(playerIDs?: (Array<string>) | null): (GKLeaderboard) | null
Swift declaration
init?(playerIDs: [String]?)
init · iOS 8.0+ · Deprecated in iOS 14.0

init

TypeScript
static initPlayers(players: Array<GKPlayer>): GKLeaderboard
Swift declaration
init(players: [GKPlayer])
method · iOS 14.0+

loadEntries

TypeScript
loadEntriesForTimeScopeRangeCompletionHandler(playerScope: GKLeaderboard_PlayerScope, timeScope: GKLeaderboard_TimeScope, range: SDKHandle, completionHandler: ((arg0: (GKLeaderboard_Entry) | null, arg1: (Array<GKLeaderboard_Entry>) | null, arg2: number, arg3: (NativeError) | null) => void)): void
Swift declaration
func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry], Int)
method · iOS 14.0+

loadEntries

TypeScript
loadEntriesForTimeScopeCompletionHandler(players: Array<GKPlayer>, timeScope: GKLeaderboard_TimeScope, completionHandler: ((arg0: (GKLeaderboard_Entry) | null, arg1: (Array<GKLeaderboard_Entry>) | null, arg2: (NativeError) | null) => void)): void
Swift declaration
func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry])
method · iOS 7.0+

loadImage

TypeScript
loadImage(completionHandler?: (((arg0: (_UIKit_UIImage) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func loadImage() async throws -> UIImage
method · iOS 14.0+

loadPreviousOccurrence

TypeScript
loadPreviousOccurrence(completionHandler: ((arg0: (GKLeaderboard) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadPreviousOccurrence() async throws -> GKLeaderboard?
method · iOS 4.0+ · Deprecated in iOS 14.0

loadScores

TypeScript
loadScores(completionHandler?: (((arg0: (Array<GKScore>) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func loadScores(completionHandler: (([GKScore]?, (any Error)?) -> Void)? = nil)
method · iOS 14.0+

submitScore

TypeScript
submitScoreContextPlayerCompletionHandler(score: number, context: number, player: GKPlayer, completionHandler: ((arg0: (NativeError) | null) => void)): void
Swift declaration
func submitScore(_ score: Int, context: Int, player: GKPlayer) async throws
get · iOS 26.0+

activityIdentifier

TypeScript
get activityIdentifier(): string
Swift declaration
var activityIdentifier: String { get }
get · iOS 26.0+

activityProperties

TypeScript
get activityProperties(): Record<string, string>
Swift declaration
var activityProperties: [String : String] { get }
get · iOS 14.0+

baseLeaderboardID

TypeScript
get baseLeaderboardID(): string
Swift declaration
var baseLeaderboardID: String { get }
get · iOS 14.0+

duration

TypeScript
get duration(): number
Swift declaration
var duration: TimeInterval { get }
get · iOS 6.0+

groupIdentifier

TypeScript
get groupIdentifier(): (string) | null
Swift declaration
var groupIdentifier: String? { get }
get · iOS 7.0+ · Deprecated in iOS 14.0

identifier

TypeScript
get identifier(): (string) | null
Swift declaration
var identifier: String? { get set }
set · iOS 7.0+ · Deprecated in iOS 14.0

identifier

TypeScript
set identifier(value: (string) | null)
Swift declaration
var identifier: String? { get set }
get · iOS 26.0+

isHidden

TypeScript
get isHidden(): boolean
Swift declaration
var isHidden: Bool { get }
get · iOS 26.0+

leaderboardDescription

TypeScript
get leaderboardDescription(): string
Swift declaration
var leaderboardDescription: String { get }
get · iOS 4.1+ · Deprecated in iOS 14.0

isLoading

TypeScript
get isLoading(): boolean
Swift declaration
var isLoading: Bool { get }
get · iOS 4.0+ · Deprecated in iOS 14.0

localPlayerScore

TypeScript
get localPlayerScore(): (GKScore) | null
Swift declaration
var localPlayerScore: GKScore? { get }
get · iOS 4.0+ · Deprecated in iOS 14.0

maxRange

TypeScript
get maxRange(): number
Swift declaration
var maxRange: Int { get }
get · iOS 14.0+

nextStartDate

TypeScript
get nextStartDate(): (globalThis.Date) | null
Swift declaration
var nextStartDate: Date? { get }
get · iOS 4.0+ · Deprecated in iOS 14.0

playerScope

TypeScript
get playerScope(): GKLeaderboard_PlayerScope
Swift declaration
var playerScope: GKLeaderboard.PlayerScope { get set }
set · iOS 4.0+ · Deprecated in iOS 14.0

playerScope

TypeScript
set playerScope(value: GKLeaderboard_PlayerScope)
Swift declaration
var playerScope: GKLeaderboard.PlayerScope { get set }
get · iOS 4.0+ · Deprecated in iOS 14.0

range

TypeScript
get range(): SDKHandle
Swift declaration
var range: NSRange { get set }
set · iOS 4.0+ · Deprecated in iOS 14.0

range

TypeScript
set range(value: SDKHandle)
Swift declaration
var range: NSRange { get set }
get · iOS 26.0+

releaseState

TypeScript
get releaseState(): GKReleaseState
Swift declaration
var releaseState: GKReleaseState { get }
get · iOS 4.0+ · Deprecated in iOS 14.0

scores

TypeScript
get scores(): (Array<GKScore>) | null
Swift declaration
var scores: [GKScore]? { get }
get · iOS 14.0+

startDate

TypeScript
get startDate(): (globalThis.Date) | null
Swift declaration
var startDate: Date? { get }
get · iOS 4.0+ · Deprecated in iOS 14.0

timeScope

TypeScript
get timeScope(): GKLeaderboard_TimeScope
Swift declaration
var timeScope: GKLeaderboard.TimeScope { get set }
set · iOS 4.0+ · Deprecated in iOS 14.0

timeScope

TypeScript
set timeScope(value: GKLeaderboard_TimeScope)
Swift declaration
var timeScope: GKLeaderboard.TimeScope { get set }
get · iOS 4.1+

title

TypeScript
get title(): (string) | null
Swift declaration
var title: String? { get }
get · iOS 14.0+

type

TypeScript
get type(): GKLeaderboard_LeaderboardType
Swift declaration
var type: GKLeaderboard.LeaderboardType { get }

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

GKLeaderboard.init()

inherited init: cannot prove legal (class declares 2 custom initializers)

All GameKit types →