-
Notifications
You must be signed in to change notification settings - Fork 13
Summoner Spells
Summoner spells are skills chosen by summoners in champion select. They customize playstyle and offer new strategies.
- SummonerSpells()
- SummonerSpell(by: SummonerSpellId)
- SummonerSpell(byName: String)
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: ([SummonerSpell]?, String?)
. SummonerSpell array contains all informations related to a summoner spell as well as an unique identifier and will be nil only if an error occured. The String parameter contains the first error description encountered if existing.
league.lolAPI.getSummonerSpells() { (summonerSpells, errorMsg) in
if let summonerSpells = summonerSpells {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
SummonerSpell (By SummonerSpellId)
- SummonerSpellId: Represents the unique identifier of a summoner spell. See SummonerSpells above to get this identifier.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (SummonerSpell?, String?)
. SummonerSpell contains all informations related to the summoner spell with unique identifier matching parameter and will be nil only if summoner spell with parameter identifier does not exist. The String parameter contains the first error description encountered if existing.
league.lolAPI.getSummonerSpell(by: SummonerSpellId(14)) { (summonerSpell, errorMsg) in
if let summonerSpell = summonerSpell {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
- byName: The name of the desired summoner spell.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (SummonerSpell?, String?)
. SummonerSpell contains all informations related to the summoner spell with name or nameId matching parameter and will be nil only if summoner spell with name or nameId matching byName does not exist. The String parameter contains the first error description encountered if existing.
league.lolAPI.getSummonerSpell(byName: "Ignite") { (summonerSpell, errorMsg) in
if let summonerSpell = summonerSpell {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}