LeaderboardsAPI
public enum LeaderboardsAPI
Caseless enumeration with static methods to send Leaderboard Requests
-
Sends a request to get leaderboard from the API.
Declaration
Swift
public static func getLeaderboards(with parameters: Parameters? = nil, completion: ResponseCompletion<[Leaderboard]> = nil)
Parameters
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get leaderboard for a page from the API.
Declaration
Swift
public static func getLeaderboards(forPage page: Int, completion: ResponseCompletion<[Leaderboard]> = nil)
Parameters
page
The page of the leaderboard.
completion
The closure to be executed once the request has finished.
-
Sends a request to get leaderboard.
Declaration
Swift
public static func getLeaderboard(name: String, category: String, with parameters: Parameters? = nil, completion: ResponseCompletion<[Leaderboard]> = nil)
Parameters
name
The name of the leaderboard.
category
The category of the leaderboard.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get leaderboard.
Declaration
Swift
public static func getAroundMeLeaderboard(name: String, page: Int, size: Int, buffer: Int, completion: ResponseCompletion<Leaderboard.Feed> = nil)
Parameters
name
The name of the leaderboard.
page
The page of the leaderboard.
size
The expected size of the result.
buffer
The buffer for the result.
completion
The closure to be executed once the request has finished.