-
Notifications
You must be signed in to change notification settings - Fork 13
Runnetera Ranked
Antoine CLOP edited this page Aug 2, 2020
·
3 revisions
Runnetera ranked endpoint. There is currently only one method, that return the leaderboard for a specific region.
- getLeaderboard(on: WorldRegion)
- WorldRegion: The world region (America, Asia, Europe) to get the leaderboard from.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: ([RunneteraPlayer]?, String?)
. RunneteraPlayer contains the player name, and its rank in the leaderboard. The String parameter contains the first error description encountered if existing.
league.lorAPI.getLeaderboard(on: .America) { (players, errorMsg) in
if let players = players {
print("Success!")
} else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}