-
Notifications
You must be signed in to change notification settings - Fork 13
Clash
Clash tournament system in League of Legends. The following methods provide information about teams, players and tournaments in Clash.
- getClashPlayers(by SummonerId, on: Region)
- getClashTeam(by: TeamId, on: Region)
- getClashTournaments(on: Region)
- getClashTournament(by: TeamId, on: Region)
- getClashTournament(by: TournamentId, on: Region)
- SummonerId: Represents the unique identifier of a summoner.
- Region: The region where Summoner is playing.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: ([ClashPlayer]?, String?)
. ClashPlayer array contains all information about a summoner in clash, such as teamId, position and role in the team. If player didn't play Clash, the array will be empty. If the array is nil, the summonerId might be invalid. The String parameter contains the first error description encountered if existing.
league.lolAPI.getClashPlayers(by: SummonerId("l1u59aGq69RycT9It-N-DjdxcVLauJsGX_-LPMauB094Qiw"), on: .EUW) { (players, errorMsg) in
if let players = players {
print("Success!")
} else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
- TeamId: Represents the unique identifier of a Clash team.
- Region: The region where the team has been created.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (ClashTeam?, String?)
. ClashTeam contains all information about a Clash team, such as the tournament it participated in, the summoners of the team, name, tier and iconId. Result will be nil only if teamId was invalid. The String parameter contains the first error description encountered if existing.
league.lolAPI.getClashTeam(by: TeamId("7c76ab62-8ad4-43d0-83a0-757e457e2f15"), on: .EUW) { (team, errorMsg) in
if let team = team {
print("Success!")
} else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
- Region: The region where Summoner is playing.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: ([ClashTournament]?, String?)
. ClashTournament array contains all information about active and upcoming Clash tournaments. Result will be nil only if an unexpected error occurred. The String parameter contains the first error description encountered if existing.
league.lolAPI.getClashTournaments(on: .EUW) { (tournaments, errorMsg) in
if let tournaments = tournaments {
print("Success!")
} else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
ClashTournament (by TeamId)
- TeamId: Represents the unique identifier of a Clash team.
- Region: The region where Summoner is playing.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (ClashTournament?, String?)
. ClashTournament contains all information about the different tournament phases. Result will be nil only if teamId was invalid. The String parameter contains the first error description encountered if existing.
league.lolAPI.getClashTournament(by: TeamId("7c76ab62-8ad4-43d0-83a0-757e457e2f15"), on: .EUW) { (tournament, errorMsg) in
if let tournament = tournament {
print("Success!")
} else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
ClashTournament (by TournamentId)
- TournamentId: Represents the unique identifier of a Clash tournament.
- Region: The region where Summoner is playing.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (ClashTournament?, String?)
. ClashTournament contains all information about the different tournament phases. Result will be nil only if teamId was invalid. The String parameter contains the first error description encountered if existing.
league.lolAPI.getClashTournament(by: TournamentId(2001), on: .EUW) { (tournament, errorMsg) in
if let tournament = tournament {
print("Success!")
} else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}