Skip to content

Summoner Spells

Antoine CLOP edited this page Aug 1, 2020 · 2 revisions

Summoner Spells

Summoner spells are skills chosen by summoners in champion select. They customize playstyle and offer new strategies.

Methods

  • SummonerSpells()
  • SummonerSpell(by: SummonerSpellId)
  • SummonerSpell(byName: String)

SummonerSpells

Parameters

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.

Usage example

league.lolAPI.getSummonerSpells() { (summonerSpells, errorMsg) in
    if let summonerSpells = summonerSpells {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

SummonerSpell (By SummonerSpellId)

Parameters

  • 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.

Usage example

league.lolAPI.getSummonerSpell(by: SummonerSpellId(14)) { (summonerSpell, errorMsg) in
    if let summonerSpell = summonerSpell {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

SummonerSpell (By Name)

Parameters

  • 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.

Usage example

league.lolAPI.getSummonerSpell(byName: "Ignite") { (summonerSpell, errorMsg) in
    if let summonerSpell = summonerSpell {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}
Clone this wiki locally