Contents

loadRecentPlayers(completionHandler:)

Loads players from the friends list or players that recently participated in a game with the local player.

Declaration

func loadRecentPlayers(completionHandler: (@Sendable ([GKPlayer]?, (any Error)?) -> Void)? = nil)
func loadRecentPlayers() async throws -> [GKPlayer]

Parameters

  • completionHandler:

    The block that GameKit calls when it completes the request.

    The block receives the following parameters:

    recentPlayers

    Players from the friends list or players that recently participated in a game with the local player.

    error

    Describes an error if it occurs, or nil if the operation completes. Possible errors include network and authentication issues.

See Also

Accessing Friends and Recents