load(withIdentifier:completionHandler:)
Loads a specific game session.
Declaration
class func load(withIdentifier identifier: String, completionHandler: @escaping @Sendable (GKGameSession?, (any Error)?) -> Void)class func load(withIdentifier identifier: String) async throws -> GKGameSessionParameters
- identifier:
A unique string that identifies the game session to be loaded.
- completionHandler:
A block that is called after the game session has been loaded.
- session
The
GKGameSessionobject associated with the specified identifier.- error
If an error occurred, this parameter holds an error object that explains the error. Otherwise, the value of this parameter is nil. See
GameKit Constantsfor a list of error codes specific to GameKit.