sectionIndexTitles & sectionForSectionIndexTitle
func sectionIndexTitles(for tableView: UITableView) -> [String]? {
let consonantsAndAlphabets: [String] = ["ㄱ", "ㄴ", "ㄷ", "ㄹ", "ㅁ", "ㅂ", "ㅅ", "ㅇ", "ㅈ", "ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
return consonantsAndAlphabets
}
func tableView(_ tableView: UITableView, sectionForSectionIndexTitle title: String, at index: Int) -> Int {
return list.firstIndex(where: {$0.title.uppercased() == title.uppercased()}) ?? 0
}