まずtableView(tableView, cellForRowAt: indexPath)でindexPathを元にcellを作成します。
あとはcell -> textLabel -> textと辿っていくだけです。
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell: UITableViewCell = self.tableView(tableView, cellForRowAt: indexPath)
print((cell.textLabel?.text)!)
}