-
Notifications
You must be signed in to change notification settings - Fork 12
TFT Ranked Leagues
TFT Leagues are group of summoners of the same skill level. The following methods can help getting some player statistics such as win rate or ranking level.
- ChallengerLeague(on: Region)
- GrandMasterLeague(on: Region)
- MasterLeague(on: Region)
- RankedEntries(for: SummonerId, on: Region)
- League(by: TFTLeagueId, on: Region)
- Entries(on: Region, division: RankedDivision, page: Int = 1)
- Region: The region of desired challenger league.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (League?, String?)
. League contains all TFT league related informations and will be nil only if an error occured. The String parameter contains the first error description encountered if existing.
league.tftAPI.getChallengerLeague(on: .EUW) { (league, errorMsg) in
if let league = league {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
- Region: The region of desired grand master league.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (League?, String?)
. League contains all TFT league related informations and will be nil only if an error occured. The String parameter contains the first error description encountered if existing.
league.tftAPI.getGrandMasterLeague(on: .EUW) { (league, errorMsg) in
if let league = league {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
- Region: The region of desired master league.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (League?, String?)
. League contains all TFT league related informations and will be nil only if an error occured. The String parameter contains the first error description encountered if existing.
league.tftAPI.getMasterLeague(on: .EUW) { (league, errorMsg) in
if let league = league {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
- SummonerId: Represents the unique identifier of a summoner. See Summoners to get this identifier.
- Region: The region where the summoner plays.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: ([RankedEntry]?, String?)
. RankedEntry array contains all summoner's ranked informations for TFT and will be nil only if summoner was not found on this region or has not played TFT ranked games this season. The String parameter contains the first error description encountered if existing.
league.tftAPI.getRankedEntries(for: SummonerId("xc8IRVLGV1Gb75sbz8JoLdRvIJ_yAKNsSG1RBQVtnGZqZV8"), on: .EUW) { (rankedEntries, errorMsg) in
if let rankedEntries = rankedEntries {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
- TFTLeagueId: Represents the unique identifier of a TFT league. To get this identifier, you must request getTFTRankedEntries first.
- Region: The region where TFT league with TFTLeagueId exists.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (League?, String?)
. League contains all TFT league related informations and will be nil only if league does not exists on the specified region. The String parameter contains the first error description encountered if existing.
league.tftAPI.getLeague(by: TFTLeagueId("e817b750-fc49-11e7-97bd-c81f66dd0e0d"), on: .EUW) { (league, errorMsg) in
if let league = league {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
- Region: The region to execute the request against.
- RankedDivision: The full division desired (Tier + Division). Tier starts from IRON to DIAMOND and division starts from 4 ("IV") to 1 ("I").
- Page: Optional parameter specifying the desired page result starting at 1.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: ([RankedEntry]?, String?)
. The result of this request contain players information in the specified division/queue. See RankedEntry. The String parameter contains the first error description encountered if existing.
guard let tier = RankedTier(.Diamond) else { return }
league.tftAPI.getEntries(on: .EUW, division: RankedDivision(tier: tier, divisionRoman: "I")) { (entries, errorMsg) in
if let entries = entries {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}