Instance Method

loadImageWithCompletionHandler:

The image associated with the default leaderboard.

Declaration

iOS, Mac Catalyst
- (void)loadImageWithCompletionHandler:(void (^)(UIImage *image, NSError *error))completionHandler;
macOS
- (void)loadImageWithCompletionHandler:(void (^)(NSImage *image, NSError *error))completionHandler;

Parameters

completionHandler

A block to be called after the scores are retrieved from the server.

The block receives the following parameters:

image

Contains the image associated with the leaderboard.

error

If an error occurred, this error object describes the error. If the operation was completed successfully, the value is nil.

Discussion

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

See Also

Customizing the Leaderboard Request

playerScope

A filter used to restrict the search to a subset of the players on Game Center.

GKLeaderboardPlayerScope

The scope of players to be searched for scores.

range

The numerical score rankings to return from the search.

timeScope

A filter used to restrict the search to scores that were posted within a specific period of time.

GKLeaderboardTimeScope

The period of time to which a player’s best score is restricted.

identifier

The named leaderboard to retrieve information from.