Tengo una vista de tabla que tiene 4 celdas. Y quiero ocultar las dos primeras celdas por unos segundos y estoy haciendo esto:
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { if historyArray.count > 0 { cell.alpha = 0 if indexPath.row == 0 || indexPath.row == 1 { UIView.animate( withDuration: 1, delay: 0.05 * Double(indexPath.row), animations: { cell.alpha = 1 }) } }pero este código no me ha funcionado. como hacer esto.
¿Puedes probar esto?
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { if indexPath.row == 0 || indexPath.row == 1 { cell.transform = CGAffineTransform(translationX: self.view.frame.width, y: 0) UIView.animate(withDuration: 1) { cell.transform = .identity } } }