Я пытаюсь получить текст UITableViewCell в моем
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let selectedCell = tableView.cellForRow(at: indexPath)
let cellLabel = selectedCell!.textLabel!.text
print(cellLabel)
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let musicCell = music[indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: "MusicCell") as! MusicCell
cell.setMusic(music: musicCell)
return cell
}
, но он возвращает ноль.
MusicListView - это мой UIViewController, и я расширил его
extension MusicListView: UITableViewDataSource, UITableViewDelegate {
}
Любая помощь будет принята с благодарностью:)