Я пытаюсь использовать базовую анимацию для UIImageView
в клетке. Я не уверен, как получить доступ к ячейке или UIImageView
.
Я использую Swift 5.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) as! CountryListCell
cell.accessoryType = .disclosureIndicator
let str = factsJsonList[indexPath.row].country
let image = UIImage(named: str)
cell.flagImageView.image = image
cell.flagNameLabel.text = str.uppercased()
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = [tableView.cellForRow(at: indexPath)]
// TODO :core animate the image view
let vc = CountryFactListVC()
vc.country = factsJsonList[indexPath.row]
navigationController?.pushViewController(vc, animated: true)
}