Skip to content

Champion Mastery

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

Champion Mastery

Champion mastery is the experience a summoner acquires on every champions. Each mastery level on a champion increase summoner's mastery score.

Methods

ChampionMasteries

Parameters

  • 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: ([ChampionMastery]?, String?). ChampionMastery array contains masteries and will be nil only if summoner was not found on this region. The String parameter contains the first error description encountered if existing.

Usage example

league.lolAPI.getChampionMasteries(by: SummonerId("xc8IRVLGV1Gb75sbz8JoLdRvIJ_yAKNsSG1RBQVtnGZqZV8"), on: .EUW) { (championMasteries, errorMsg) in
    if let championMasteries = championMasteries {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

ChampionMastery

Parameters

  • SummonerId: Represents the unique identifier of a summoner. See Summoners to get this identifier.
  • ChampionId: Represents the unique identifier of a champion. See Champions 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: ([ChampionMastery]?, String?). ChampionMastery contains mastery for a specific champion and will be nil only if summoner was not found on this region or champion does not exists. The String parameter contains the first error description encountered if existing.

Usage example

league.lolAPI.getChampionMastery(by: SummonerId("xc8IRVLGV1Gb75sbz8JoLdRvIJ_yAKNsSG1RBQVtnGZqZV8"), for: ChampionId(103), on: .EUW) { (championMastery, errorMsg) in
    if let championMastery = championMastery {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

MasteryScore

Parameters

  • 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: (Int?, String?). The Int value represents the total mastery score and will be nil only if summoner was not found on this region. The String parameter contains the first error description encountered if existing.

Usage example

league.lolAPI.getMasteryScore(for: SummonerId("xc8IRVLGV1Gb75sbz8JoLdRvIJ_yAKNsSG1RBQVtnGZqZV8"), on: .EUW) { (masteryScore, errorMsg) in
    if let masteryScore = masteryScore {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}
Clone this wiki locally