Instance Method

loadRecentPlayers(completionHandler:)

Returns an array of players the local player recently played with.

Declaration

func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil)

Parameters

completionHandler

A block that is called after the recent player list has been loaded.

recentPlayers

An array of players that the local player has recently played with.

error

If an error occurred, this parameter holds an error object that explains the error. Otherwise, the value of this parameter is nil. Possible errors are networking issues or unauthenticated player.

Discussion

This method retrieves an array of players who have previously played with the local player or any players that are on the local player's legacy friends list.

See Also

Accessing the Shared Local Player

class var local: GKLocalPlayer

Retrieves the shared instance of the local player.